diff options
-rw-r--r-- | composer.json | 5 | ||||
-rw-r--r-- | core/Loader.php | 9 | ||||
-rw-r--r-- | plugins/CoreConsole/Commands/TestsSetupFixture.php | 4 | ||||
-rw-r--r-- | tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php (renamed from tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorIdAndUserId.php) | 0 | ||||
-rw-r--r-- | tests/PHPUnit/bootstrap.php | 5 |
5 files changed, 5 insertions, 18 deletions
diff --git a/composer.json b/composer.json index 392f934e03..1e79ad7255 100644 --- a/composer.json +++ b/composer.json @@ -30,6 +30,11 @@ "Archive_": "libs/" } }, + "autoload-dev": { + "psr-4": { + "Piwik\\Tests\\": "tests/PHPUnit/" + } + }, "require": { "php": ">=5.3.3", "twig/twig": "~1.0", diff --git a/core/Loader.php b/core/Loader.php index 932c89d5bd..b89e7743f9 100644 --- a/core/Loader.php +++ b/core/Loader.php @@ -35,13 +35,4 @@ class Loader return $loader; } - - public static function registerTestNamespace() - { - $prefix = 'Piwik\\Tests\\'; - $paths = PIWIK_INCLUDE_PATH . '/tests/PHPUnit'; - - $loader = self::getLoader(); - $loader->addPsr4($prefix, $paths, $prepend = false); - } } diff --git a/plugins/CoreConsole/Commands/TestsSetupFixture.php b/plugins/CoreConsole/Commands/TestsSetupFixture.php index 3413566eb7..8002eaaa7e 100644 --- a/plugins/CoreConsole/Commands/TestsSetupFixture.php +++ b/plugins/CoreConsole/Commands/TestsSetupFixture.php @@ -231,16 +231,12 @@ class TestsSetupFixture extends ConsoleCommand private function requireFixtureFiles(InputInterface $input) { - \Piwik\Loader::registerTestNamespace(); - require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php'; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/FakeAccess.php'; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/TestingEnvironment.php'; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/IntegrationTestCase.php'; - require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Fixture.php'; $fixturesToLoad = array( - '/tests/PHPUnit/Fixtures/*.php', '/tests/PHPUnit/UI/Fixtures/*.php', '/plugins/*/tests/Fixtures/*.php', '/plugins/*/Test/Fixtures/*.php', diff --git a/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorIdAndUserId.php b/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php index f1444bf2f2..f1444bf2f2 100644 --- a/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorIdAndUserId.php +++ b/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php diff --git a/tests/PHPUnit/bootstrap.php b/tests/PHPUnit/bootstrap.php index c78838b968..bdd1b3a771 100644 --- a/tests/PHPUnit/bootstrap.php +++ b/tests/PHPUnit/bootstrap.php @@ -30,15 +30,11 @@ error_reporting(E_ALL | E_NOTICE); require_once PIWIK_INCLUDE_PATH . '/core/Loader.php'; \Piwik\Loader::init(); -\Piwik\Loader::registerTestNamespace(); require_once PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php'; require_once PIWIK_INCLUDE_PATH . '/core/testMinimumPhpVersion.php'; -require_once PIWIK_INCLUDE_PATH . '/core/FrontController.php'; -require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Fixture.php'; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/DatabaseTestCase.php'; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/IntegrationTestCase.php'; -require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/ConsoleCommandTestCase.php'; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/BenchmarkTestCase.php'; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/FakeAccess.php'; require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/TestingEnvironment.php'; @@ -49,7 +45,6 @@ if (getenv('PIWIK_USE_XHPROF') == 1) { // require test fixtures $fixturesToLoad = array( - '/tests/PHPUnit/Fixtures/*.php', '/tests/PHPUnit/UI/Fixtures/*.php', '/plugins/*/tests/Fixtures/*.php', '/plugins/*/Test/Fixtures/*.php', |