From 28e9b28588452df1838e9b18e9cab5539bb5f8b0 Mon Sep 17 00:00:00 2001 From: mattab <matthieu.aubry@gmail.com> Date: Tue, 6 Oct 2015 12:30:42 +1300 Subject: [PATCH] Implementing DI properly in constructor --- core/Tracker/TableLogAction/Cache.php | 1 - tests/PHPUnit/Integration/SegmentTest.php | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/Tracker/TableLogAction/Cache.php b/core/Tracker/TableLogAction/Cache.php index 5f3abf76a1..3c7862c25c 100644 --- a/core/Tracker/TableLogAction/Cache.php +++ b/core/Tracker/TableLogAction/Cache.php @@ -11,7 +11,6 @@ namespace Piwik\Tracker\TableLogAction; use Piwik\Common; use Piwik\Config; -use Piwik\Container\StaticContainer; use Psr\Log\LoggerInterface; class Cache diff --git a/tests/PHPUnit/Integration/SegmentTest.php b/tests/PHPUnit/Integration/SegmentTest.php index 3c4bec7802..033d4a4212 100644 --- a/tests/PHPUnit/Integration/SegmentTest.php +++ b/tests/PHPUnit/Integration/SegmentTest.php @@ -12,6 +12,7 @@ use Exception; use Piwik\Cache; use Piwik\Common; use Piwik\Config; +use Piwik\Container\StaticContainer; use Piwik\Db; use Piwik\Segment; use Piwik\Tests\Framework\Mock\FakeAccess; @@ -698,7 +699,7 @@ class SegmentTest extends IntegrationTestCase "found", )); - $cache = new TableLogAction\Cache(); + $cache = StaticContainer::get('Piwik\Tracker\TableLogAction\Cache'); $this->assertTrue( empty($cache->isEnabled) ); $this->assertCacheWasHit($hit = 0); $this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query)); @@ -768,7 +769,7 @@ class SegmentTest extends IntegrationTestCase 3, // pageUrl!@not-found )); - $cache = new TableLogAction\Cache(); + $cache = StaticContainer::get('Piwik\Tracker\TableLogAction\Cache'); $this->assertTrue( !empty($cache->isEnabled) ); $this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query)); @@ -836,7 +837,7 @@ class SegmentTest extends IntegrationTestCase "not-found", // pageUrl!@not-found )); - $cache = new TableLogAction\Cache(); + $cache = StaticContainer::get('Piwik\Tracker\TableLogAction\Cache'); $this->assertTrue( !empty($cache->isEnabled) ); $this->assertEquals($this->removeExtraWhiteSpaces($expected), $this->removeExtraWhiteSpaces($query)); -- GitLab