diff options
author | diosmosis <benaka@piwik.pro> | 2015-09-24 02:18:09 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-09-24 02:18:09 +0300 |
commit | c6d26d81ea91eb2eddac06c22f83c2f4322b6cd0 (patch) | |
tree | f5bd825cee39c484624969543ac99ea67ea7a093 /plugins/SegmentEditor | |
parent | d108a3229b8d50baf0310e0686d0d0ff453e851b (diff) |
Tweak to unit test.
Diffstat (limited to 'plugins/SegmentEditor')
-rw-r--r-- | plugins/SegmentEditor/tests/Unit/SegmentQueryDecoratorTest.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/SegmentEditor/tests/Unit/SegmentQueryDecoratorTest.php b/plugins/SegmentEditor/tests/Unit/SegmentQueryDecoratorTest.php index 7984a11220..4c86f54fbe 100644 --- a/plugins/SegmentEditor/tests/Unit/SegmentQueryDecoratorTest.php +++ b/plugins/SegmentEditor/tests/Unit/SegmentQueryDecoratorTest.php @@ -9,6 +9,7 @@ namespace Piwik\Plugins\SegmentEditor\tests\Unit; use Piwik\Plugins\SegmentEditor\SegmentQueryDecorator; +use Piwik\Plugins\SegmentEditor\Services\StoredSegmentService; use Piwik\Segment\SegmentExpression; /** @@ -33,8 +34,9 @@ class SegmentQueryDecoratorTest extends \PHPUnit_Framework_TestCase { parent::setUp(); - $mockApi = $this->getMockSegmentEditorApi(); - $this->decorator = new SegmentQueryDecorator($mockApi); + /** @var StoredSegmentService $service */ + $service = $this->getMockSegmentEditorService(); + $this->decorator = new SegmentQueryDecorator($service); } public function test_getSelectQueryString_DoesNotDecorateSql_WhenNoSegmentUsed() @@ -77,7 +79,7 @@ class SegmentQueryDecoratorTest extends \PHPUnit_Framework_TestCase $this->assertStringStartsWith('/* idSegments = [2, 4] */', $query['sql']); } - private function getMockSegmentEditorApi() + private function getMockSegmentEditorService() { $mock = $this->getMock('Piwik\Plugins\SegmentEditor\Services\StoredSegmentService', array('getSegmentsToAutoArchive'), array(), '', $callOriginalConstructor = false); |