diff options
author | Stefan Giehl <stefan@matomo.org> | 2022-03-10 23:08:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 23:08:31 +0300 |
commit | c11469e4199405628e97650914f0cdbdea94dac7 (patch) | |
tree | af07edd44b6ac95fa3cd6e439d435cf6c55e9ad5 /tests/PHPUnit/System | |
parent | 05082abdca8909cf27137773f129cf66f495922b (diff) |
[Codingstyle] Disallow unused use statements (#18520)
* Forbid unused use statements
* Fix some incorrect classnames
* fix tests
* remove unused use statements
Diffstat (limited to 'tests/PHPUnit/System')
10 files changed, 5 insertions, 30 deletions
diff --git a/tests/PHPUnit/System/ApiGetReportMetadataTest.php b/tests/PHPUnit/System/ApiGetReportMetadataTest.php index 82743b9131..3c7f834e49 100644 --- a/tests/PHPUnit/System/ApiGetReportMetadataTest.php +++ b/tests/PHPUnit/System/ApiGetReportMetadataTest.php @@ -8,7 +8,6 @@ namespace Piwik\Tests\System; use Piwik\API\Proxy; -use Piwik\Cache; use Piwik\Tests\Framework\TestCase\SystemTestCase; use Piwik\Tests\Fixtures\ThreeGoalsOnePageview; diff --git a/tests/PHPUnit/System/ArchiveInvalidationTest.php b/tests/PHPUnit/System/ArchiveInvalidationTest.php index 63c23b47a5..7e50a9cec5 100644 --- a/tests/PHPUnit/System/ArchiveInvalidationTest.php +++ b/tests/PHPUnit/System/ArchiveInvalidationTest.php @@ -9,10 +9,7 @@ namespace Piwik\Tests\System; use Piwik\API\Request; use Piwik\ArchiveProcessor\Rules; -use Piwik\Common; use Piwik\Config; -use Piwik\Date; -use Piwik\Db; use Piwik\Plugins\SegmentEditor\API; use Piwik\Tests\Fixtures\VisitsTwoWebsitesWithAdditionalVisits; use Piwik\Tests\Framework\TestCase\SystemTestCase; diff --git a/tests/PHPUnit/System/BlobReportLimitingTest.php b/tests/PHPUnit/System/BlobReportLimitingTest.php index 8d8a055b5e..0cacc3e832 100644 --- a/tests/PHPUnit/System/BlobReportLimitingTest.php +++ b/tests/PHPUnit/System/BlobReportLimitingTest.php @@ -7,13 +7,9 @@ */ namespace Piwik\Tests\System; -use Piwik\Application\Kernel\GlobalSettingsProvider; use Piwik\Cache; use Piwik\Config; -use Piwik\Date; use Piwik\Plugins\Actions\ArchivingHelper; -use Piwik\Tests\Framework\Fixture; -use Piwik\Tests\Framework\Mock\TestConfig; use Piwik\Tests\Framework\TestCase\SystemTestCase; use Piwik\Tests\Fixtures\ManyVisitsWithMockLocationProvider; diff --git a/tests/PHPUnit/System/ConsoleTest.php b/tests/PHPUnit/System/ConsoleTest.php index a82d31ecfb..3ae12f7b6d 100644 --- a/tests/PHPUnit/System/ConsoleTest.php +++ b/tests/PHPUnit/System/ConsoleTest.php @@ -9,9 +9,7 @@ namespace Piwik\Tests\System; use Piwik\CliMulti\CliPhp; -use Piwik\Config; use Piwik\Container\StaticContainer; -use Piwik\Development; use Piwik\Plugin\ConsoleCommand; use Piwik\Plugins\Monolog\Handler\FailureLogMessageDetector; use Piwik\Tests\Framework\Fixture; @@ -166,17 +164,17 @@ class ConsoleTest extends ConsoleCommandTestCase $output = $this->normalizeOutput($output); $expected = <<<END -PHP Fatal error: Allowed memory size of X bytes exhausted (tried to allocate X bytes) in /tests/PHPUnit/System/ConsoleTest.php on line 85 +PHP Fatal error: Allowed memory size of X bytes exhausted (tried to allocate X bytes) in /tests/PHPUnit/System/ConsoleTest.php on line 83 -Fatal error: Allowed memory size of X bytes exhausted (tried to allocate X bytes) in /tests/PHPUnit/System/ConsoleTest.php on line 85 +Fatal error: Allowed memory size of X bytes exhausted (tried to allocate X bytes) in /tests/PHPUnit/System/ConsoleTest.php on line 83 *** IN SAFEMODE *** Matomo encountered an error: Allowed memory size of X bytes exhausted (tried to allocate X bytes) (which lead to: Error: array ( 'type' => 1, 'message' => 'Allowed memory size of X bytes exhausted (tried to allocate X bytes)', 'file' => '/tests/PHPUnit/System/ConsoleTest.php', - 'line' => 85, - 'backtrace' => ' on /tests/PHPUnit/System/ConsoleTest.php(85) -#0 /tests/PHPUnit/System/ConsoleTest.php(72): Piwik\\\\Tests\\\\System\\\\TestCommandWithFatalError->executeImpl() + 'line' => 83, + 'backtrace' => ' on /tests/PHPUnit/System/ConsoleTest.php(83) +#0 /tests/PHPUnit/System/ConsoleTest.php(70): Piwik\\\\Tests\\\\System\\\\TestCommandWithFatalError->executeImpl() #1 /vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Piwik\\\\Tests\\\\System\\\\TestCommandWithFatalError->execute() ', )) diff --git a/tests/PHPUnit/System/FlattenReportsTest.php b/tests/PHPUnit/System/FlattenReportsTest.php index 0785639de1..ecef5caf1a 100644 --- a/tests/PHPUnit/System/FlattenReportsTest.php +++ b/tests/PHPUnit/System/FlattenReportsTest.php @@ -8,7 +8,6 @@ namespace Piwik\Tests\System; use Piwik\EventDispatcher; -use Piwik\Piwik; use Piwik\Plugin\Manager; use Piwik\Plugins\Referrers\Reports\GetWebsites; use Piwik\Tests\Framework\TestCase\SystemTestCase; diff --git a/tests/PHPUnit/System/OneVisitorNoKeywordSpecifiedTest.php b/tests/PHPUnit/System/OneVisitorNoKeywordSpecifiedTest.php index cfa386718d..7afcdc86f4 100644 --- a/tests/PHPUnit/System/OneVisitorNoKeywordSpecifiedTest.php +++ b/tests/PHPUnit/System/OneVisitorNoKeywordSpecifiedTest.php @@ -7,7 +7,6 @@ */ namespace Piwik\Tests\System; -use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\TestCase\SystemTestCase; use Piwik\Tests\Fixtures\TwoVisitsNoKeywordWithBot; diff --git a/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest.php b/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest.php index 6a3af0d3fd..baf0fd2fb5 100644 --- a/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest.php +++ b/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest.php @@ -13,7 +13,6 @@ use Piwik\Common; use Piwik\Container\StaticContainer; use Piwik\Date; use Piwik\Db; -use Piwik\DbHelper; use Piwik\Piwik; use Piwik\Tests\Framework\TestCase\SystemTestCase; use Piwik\Tests\Fixtures\VisitsOverSeveralDays; diff --git a/tests/PHPUnit/System/TrackerTest.php b/tests/PHPUnit/System/TrackerTest.php index 592b65c75c..e00d78aa7a 100644 --- a/tests/PHPUnit/System/TrackerTest.php +++ b/tests/PHPUnit/System/TrackerTest.php @@ -9,7 +9,6 @@ namespace Piwik\Tests\System; use Piwik\Common; -use Piwik\Config; use Piwik\Db; use Piwik\Option; use Piwik\Plugins\UserCountry\LocationProvider; @@ -19,7 +18,6 @@ use Piwik\Scheduler\Timetable; use Piwik\SettingsPiwik; use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; -use Piwik\Tracker; /** * @group Core diff --git a/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php b/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php index 4708ba7013..0df58a06c5 100644 --- a/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php +++ b/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php @@ -8,11 +8,6 @@ namespace Piwik\Tests\System; use Piwik\Archive; -use Piwik\Archive\ArchivePurger; -use Piwik\Cache; -use Piwik\Container\StaticContainer; -use Piwik\Date; -use Piwik\Segment; use Piwik\Tests\Framework\TestCase\SystemTestCase; use Piwik\Tests\Fixtures\TwoSitesTwoVisitorsDifferentDays; diff --git a/tests/PHPUnit/System/Utf8mb4Test.php b/tests/PHPUnit/System/Utf8mb4Test.php index 1fb18bae3d..09c7eba365 100644 --- a/tests/PHPUnit/System/Utf8mb4Test.php +++ b/tests/PHPUnit/System/Utf8mb4Test.php @@ -7,13 +7,8 @@ */ namespace Piwik\Tests\System; -use Piwik\Common; -use Piwik\Db; use Piwik\Tests\Fixtures\Utf8mb4; -use Piwik\Tests\Framework\Fixture; -use Piwik\Tracker\Action; use Piwik\Tests\Framework\TestCase\SystemTestCase; -use Piwik\Tests\Fixtures\OneVisitWithAbnormalPageviewUrls; /** * Tests for tracking parameters containing 4 byte UTF8 chars. |