diff options
author | Zoltan Flamis <flamisz@gmail.com> | 2021-03-15 05:34:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-15 05:34:03 +0300 |
commit | 1a688e5ec4c4c96f7017b59bb2dbfac78c7c81d1 (patch) | |
tree | 83ce44b8b03f6bc98d2df0d00aadfd4e1f5ccd19 /plugins/SegmentEditor/tests/Unit | |
parent | 069d2de9acb02bf337eb3d079e712a3071ee4f6d (diff) |
modify SegmentQueryDecorator so extra comment information can be saved (#17337)
* modify SegmentQueryDecorator so extra comment information can be saved
* Update LogAggregator.php
* fix tests
Diffstat (limited to 'plugins/SegmentEditor/tests/Unit')
-rw-r--r-- | plugins/SegmentEditor/tests/Unit/SegmentQueryDecoratorTest.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/SegmentEditor/tests/Unit/SegmentQueryDecoratorTest.php b/plugins/SegmentEditor/tests/Unit/SegmentQueryDecoratorTest.php index 1f7b6a29c1..593bac5bed 100644 --- a/plugins/SegmentEditor/tests/Unit/SegmentQueryDecoratorTest.php +++ b/plugins/SegmentEditor/tests/Unit/SegmentQueryDecoratorTest.php @@ -68,7 +68,8 @@ class SegmentQueryDecoratorTest extends \PHPUnit\Framework\TestCase $query = $this->decorator->getSelectQueryString($expression, '*', 'log_visit', '', array(), '', '', ''); - $this->assertStringStartsWith('/* idSegments = [3] */', $query['sql']); + $this->assertStringStartsWith('SELECT /* idSegments = [3] */', $query['sql']); + $this->assertEquals(1, substr_count($query['sql'], 'SELECT')); } public function test_getSelectQueryString_DecoratesSql_WhenMultipleStoredSegmentsMatchUsedSegment() @@ -78,7 +79,8 @@ class SegmentQueryDecoratorTest extends \PHPUnit\Framework\TestCase $query = $this->decorator->getSelectQueryString($expression, '*', 'log_visit', '', array(), '', '', ''); - $this->assertStringStartsWith('/* idSegments = [2, 4] */', $query['sql']); + $this->assertStringStartsWith('SELECT /* idSegments = [2, 4] */', $query['sql']); + $this->assertEquals(1, substr_count($query['sql'], 'SELECT')); } private function getMockSegmentEditorService() |