Skip to content
Extraits de code Groupes Projets
Valider bda5356a rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Fixing build.

parent 41fabcb3
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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()
......
......@@ -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()
......
......@@ -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()
......
......@@ -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()
......
......@@ -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();
}
......
......@@ -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())
......
......@@ -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;
}
/**
......
......@@ -9,8 +9,6 @@ use Piwik\Common;
use Piwik\Db;
use Piwik\Option;
require_once "Option.php";
/**
* Class Core_OptionTest
*
......
......@@ -9,9 +9,6 @@ use Piwik\Translate;
*/
class Core_TravisEnvironmentTest extends DatabaseTestCase
{
/**
* @group Core
*/
public function testUsageOfCorrectMysqlAdapter()
{
$mysqlAdapter = getenv('MYSQL_ADAPTER');
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter