diff options
author | diosmosis <benaka@piwik.pro> | 2014-09-19 07:55:59 +0400 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-09-19 07:55:59 +0400 |
commit | bda5356a4695f03e14f820a65077bfdebf23ab52 (patch) | |
tree | 6f5a775ac93e8b242bf7865da7c1f93c24ca7085 /tests | |
parent | 41fabcb3488f00f5840dc2c231519488322b1837 (diff) |
Fixing build.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PHPUnit/Core/API/ApiRendererTest.php | 3 | ||||
-rw-r--r-- | tests/PHPUnit/Core/API/ResponseBuilderTest.php | 2 | ||||
-rw-r--r-- | tests/PHPUnit/Core/DataTable/Filter/PivotByDimensionTest.php | 4 | ||||
-rw-r--r-- | tests/PHPUnit/Core/DataTable/Renderer/XMLTest.php | 3 | ||||
-rw-r--r-- | tests/PHPUnit/Core/Menu/MenuReportingTest.php | 4 | ||||
-rw-r--r-- | tests/PHPUnit/Fixture.php | 5 | ||||
-rw-r--r-- | tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php | 8 | ||||
-rw-r--r-- | tests/PHPUnit/Integration/Core/OptionTest.php | 2 | ||||
-rw-r--r-- | tests/PHPUnit/Integration/Core/TravisEnvironmentTest.php | 3 |
9 files changed, 22 insertions, 12 deletions
diff --git a/tests/PHPUnit/Core/API/ApiRendererTest.php b/tests/PHPUnit/Core/API/ApiRendererTest.php index a74db0bfe0..42d014ae17 100644 --- a/tests/PHPUnit/Core/API/ApiRendererTest.php +++ b/tests/PHPUnit/Core/API/ApiRendererTest.php @@ -7,7 +7,6 @@ */ use Piwik\API\ApiRenderer; -use Piwik\API\ApiRenderer\Json; /** * @group Core @@ -16,7 +15,7 @@ class ApiRendererTest extends PHPUnit_Framework_TestCase { public function setUp() { - \Piwik\Tests\Fixture::loadAllPlugins(); + \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('API')); } public function test_factory_shouldCreateAnInstance_IfValidFormatGiven() diff --git a/tests/PHPUnit/Core/API/ResponseBuilderTest.php b/tests/PHPUnit/Core/API/ResponseBuilderTest.php index 9b3b7e53e1..9d6d0bc779 100644 --- a/tests/PHPUnit/Core/API/ResponseBuilderTest.php +++ b/tests/PHPUnit/Core/API/ResponseBuilderTest.php @@ -16,7 +16,7 @@ class ResponseBuilderTest extends PHPUnit_Framework_TestCase { public function setUp() { - \Piwik\Tests\Fixture::loadAllPlugins(); + \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('API')); } public function test_getResponseException_shouldFormatExceptionDependingOnFormatAndAddDebugHelp() diff --git a/tests/PHPUnit/Core/DataTable/Filter/PivotByDimensionTest.php b/tests/PHPUnit/Core/DataTable/Filter/PivotByDimensionTest.php index e20cdaf682..790c3cb6fe 100644 --- a/tests/PHPUnit/Core/DataTable/Filter/PivotByDimensionTest.php +++ b/tests/PHPUnit/Core/DataTable/Filter/PivotByDimensionTest.php @@ -8,6 +8,7 @@ namespace Piwik\Tests\Core\DataTable\Filter; use Piwik\API\Proxy; +use Piwik\Config; use Piwik\DataTable; use Piwik\DataTable\Filter\PivotByDimension; use Piwik\DataTable\Row; @@ -17,7 +18,6 @@ use Exception; /** * @group Core - * @group PivotByDimensionTest */ class PivotByDimensionTest extends PHPUnit_Framework_TestCase { @@ -46,6 +46,8 @@ class PivotByDimensionTest extends PHPUnit_Framework_TestCase Proxy::setSingletonInstance($proxyMock); $this->segmentTableCount = 0; + + Config::getInstance()->setTestEnvironment(); } public function tearDown() diff --git a/tests/PHPUnit/Core/DataTable/Renderer/XMLTest.php b/tests/PHPUnit/Core/DataTable/Renderer/XMLTest.php index 40b58bdc13..d0b7441ee2 100644 --- a/tests/PHPUnit/Core/DataTable/Renderer/XMLTest.php +++ b/tests/PHPUnit/Core/DataTable/Renderer/XMLTest.php @@ -11,9 +11,6 @@ use Piwik\DataTable\Renderer\Xml; use Piwik\DataTable\Row; use Piwik\DataTable\Simple; -/** - * @group Only - */ class DataTable_Renderer_XMLTest extends PHPUnit_Framework_TestCase { public function setUp() diff --git a/tests/PHPUnit/Core/Menu/MenuReportingTest.php b/tests/PHPUnit/Core/Menu/MenuReportingTest.php index 09d0347959..b82c4a1aaf 100644 --- a/tests/PHPUnit/Core/Menu/MenuReportingTest.php +++ b/tests/PHPUnit/Core/Menu/MenuReportingTest.php @@ -6,6 +6,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +use Piwik\Access; use Piwik\Plugin\Report; use Piwik\Piwik; use Piwik\Metrics; @@ -28,11 +29,14 @@ class Menu_ReportingTest extends PHPUnit_Framework_TestCase { PluginManager::getInstance()->unloadPlugins(); $this->menu = MenuReporting::getInstance(); + + Access::setSingletonInstance(new FakeAccess()); } public function tearDown() { MenuReporting::getInstance()->unsetInstance(); + Access::setSingletonInstance(null); parent::tearDown(); } diff --git a/tests/PHPUnit/Fixture.php b/tests/PHPUnit/Fixture.php index 3fd7320094..f625f98001 100644 --- a/tests/PHPUnit/Fixture.php +++ b/tests/PHPUnit/Fixture.php @@ -287,6 +287,11 @@ class Fixture extends PHPUnit_Framework_Assert $_GET = $_REQUEST = array(); Translate::unloadEnglishTranslation(); + + Config::unsetInstance(); + + \Piwik\Config::getInstance()->Plugins; // make sure Plugins exists in a config object for next tests that use Plugin\Manager + // since Plugin\Manager uses getFromGlobalConfig which doesn't init the config object } public static function loadAllPlugins($testEnvironment = null, $testCaseClass = false, $extraPluginsToLoad = array()) diff --git a/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php b/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php index 34aa3aeefb..eaa6d6807d 100644 --- a/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php +++ b/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php @@ -52,6 +52,14 @@ class Core_ArchiveProcessingTest extends DatabaseTestCase $pseudoMockAccess = new FakeAccess; FakeAccess::$superUser = true; Access::setSingletonInstance($pseudoMockAccess); + + ArchiveTableCreator::$tablesAlreadyInstalled = null; + } + + public function tearDown() + { + Access::setSingletonInstance(null); + ArchiveTableCreator::$tablesAlreadyInstalled = null; } /** diff --git a/tests/PHPUnit/Integration/Core/OptionTest.php b/tests/PHPUnit/Integration/Core/OptionTest.php index e405bae453..c926e1c808 100644 --- a/tests/PHPUnit/Integration/Core/OptionTest.php +++ b/tests/PHPUnit/Integration/Core/OptionTest.php @@ -9,8 +9,6 @@ use Piwik\Common; use Piwik\Db; use Piwik\Option; -require_once "Option.php"; - /** * Class Core_OptionTest * diff --git a/tests/PHPUnit/Integration/Core/TravisEnvironmentTest.php b/tests/PHPUnit/Integration/Core/TravisEnvironmentTest.php index 7b6b233ef4..7549dac8a9 100644 --- a/tests/PHPUnit/Integration/Core/TravisEnvironmentTest.php +++ b/tests/PHPUnit/Integration/Core/TravisEnvironmentTest.php @@ -9,9 +9,6 @@ use Piwik\Translate; */ class Core_TravisEnvironmentTest extends DatabaseTestCase { - /** - * @group Core - */ public function testUsageOfCorrectMysqlAdapter() { $mysqlAdapter = getenv('MYSQL_ADAPTER'); |