| Total Complexity | 2 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 16 | class LikeTest extends TestCase |
||
| 17 | { |
||
| 18 | public function testGetExpr() |
||
| 19 | { |
||
| 20 | $qb = $this->getMockBuilder(QueryBuilder::class) |
||
| 21 | ->disableOriginalConstructor() |
||
| 22 | ->getMock(); |
||
| 23 | |||
| 24 | $qb |
||
| 25 | ->expects(self::once()) |
||
| 26 | ->method('expr') |
||
| 27 | ->willReturn(new Expr()); |
||
| 28 | |||
| 29 | $qb |
||
| 30 | ->expects(self::once()) |
||
| 31 | ->method('setParameter') |
||
| 32 | ->with(0, '%road%to%hell%') |
||
| 33 | ->willReturn($qb); |
||
| 34 | |||
| 35 | $condition = new Like(); |
||
| 36 | |||
| 37 | $expr = $condition->getExpr($qb, 0, (new Filter()) |
||
| 38 | ->setField('t.dummy') |
||
| 39 | ->setX('road to hell') |
||
| 40 | ); |
||
| 41 | |||
| 42 | self::assertSame('t.dummy LIKE ?0', (string)$expr); |
||
| 43 | } |
||
| 44 | |||
| 45 | public function testGetExprExact() |
||
| 71 | } |
||
| 72 | } |