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

Implementing DI properly in constructor

parent 8bfe5ab9
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -11,7 +11,6 @@ namespace Piwik\Tracker\TableLogAction; ...@@ -11,7 +11,6 @@ namespace Piwik\Tracker\TableLogAction;
use Piwik\Common; use Piwik\Common;
use Piwik\Config; use Piwik\Config;
use Piwik\Container\StaticContainer;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
class Cache class Cache
......
...@@ -12,6 +12,7 @@ use Exception; ...@@ -12,6 +12,7 @@ use Exception;
use Piwik\Cache; use Piwik\Cache;
use Piwik\Common; use Piwik\Common;
use Piwik\Config; use Piwik\Config;
use Piwik\Container\StaticContainer;
use Piwik\Db; use Piwik\Db;
use Piwik\Segment; use Piwik\Segment;
use Piwik\Tests\Framework\Mock\FakeAccess; use Piwik\Tests\Framework\Mock\FakeAccess;
...@@ -698,7 +699,7 @@ class SegmentTest extends IntegrationTestCase ...@@ -698,7 +699,7 @@ class SegmentTest extends IntegrationTestCase
"found", "found",
)); ));
$cache = new TableLogAction\Cache(); $cache = StaticContainer::get('Piwik\Tracker\TableLogAction\Cache');
$this->assertTrue( empty($cache->isEnabled) ); $this->assertTrue( empty($cache->isEnabled) );
$this->assertCacheWasHit($hit = 0); $this->assertCacheWasHit($hit = 0);
$this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query)); $this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query));
...@@ -768,7 +769,7 @@ class SegmentTest extends IntegrationTestCase ...@@ -768,7 +769,7 @@ class SegmentTest extends IntegrationTestCase
3, // pageUrl!@not-found 3, // pageUrl!@not-found
)); ));
$cache = new TableLogAction\Cache(); $cache = StaticContainer::get('Piwik\Tracker\TableLogAction\Cache');
$this->assertTrue( !empty($cache->isEnabled) ); $this->assertTrue( !empty($cache->isEnabled) );
$this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query)); $this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query));
...@@ -836,7 +837,7 @@ class SegmentTest extends IntegrationTestCase ...@@ -836,7 +837,7 @@ class SegmentTest extends IntegrationTestCase
"not-found", // pageUrl!@not-found "not-found", // pageUrl!@not-found
)); ));
$cache = new TableLogAction\Cache(); $cache = StaticContainer::get('Piwik\Tracker\TableLogAction\Cache');
$this->assertTrue( !empty($cache->isEnabled) ); $this->assertTrue( !empty($cache->isEnabled) );
$this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query)); $this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query));
......
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