| @@ 117-129 (lines=13) @@ | ||
| 114 | $this->assertSame($this->builder, $this->builder->orWhere($where)); |
|
| 115 | } |
|
| 116 | ||
| 117 | public function testOrderBy() |
|
| 118 | { |
|
| 119 | $this->queryBuilder |
|
| 120 | ->expects($this->once()) |
|
| 121 | ->method('sort') |
|
| 122 | ->with( |
|
| 123 | $this->identicalTo($sort = 'expression'), |
|
| 124 | $this->identicalTo('ASC') |
|
| 125 | ); |
|
| 126 | ||
| 127 | $this->assertSame($this->builder, $this->builder->orderBy($sort)); |
|
| 128 | } |
|
| 129 | ||
| 130 | public function testOrderByWithOrder() |
|
| 131 | { |
|
| 132 | $this->queryBuilder |
|
| @@ 66-74 (lines=9) @@ | ||
| 63 | $this->assertInstanceOf(DataSourceBuilderInterface::class, $this->builder); |
|
| 64 | } |
|
| 65 | ||
| 66 | public function testSelect() |
|
| 67 | { |
|
| 68 | $this->queryBuilder |
|
| 69 | ->expects($this->once()) |
|
| 70 | ->method('addSelect') |
|
| 71 | ->with($this->identicalTo($select = 'alias')); |
|
| 72 | ||
| 73 | $this->assertSame($this->builder, $this->builder->select($select)); |
|
| 74 | } |
|
| 75 | ||
| 76 | public function testInnerJoin() |
|
| 77 | { |
|
| @@ 102-110 (lines=9) @@ | ||
| 99 | $this->assertSame($this->builder, $this->builder->leftJoin($join, $alias)); |
|
| 100 | } |
|
| 101 | ||
| 102 | public function testAndWhere() |
|
| 103 | { |
|
| 104 | $this->queryBuilder |
|
| 105 | ->expects($this->once()) |
|
| 106 | ->method('andWhere') |
|
| 107 | ->with($this->identicalTo($where = 'expression')); |
|
| 108 | ||
| 109 | $this->assertSame($this->builder, $this->builder->andWhere($where)); |
|
| 110 | } |
|
| 111 | ||
| 112 | public function testOrWhere() |
|
| 113 | { |
|
| @@ 112-120 (lines=9) @@ | ||
| 109 | $this->assertSame($this->builder, $this->builder->andWhere($where)); |
|
| 110 | } |
|
| 111 | ||
| 112 | public function testOrWhere() |
|
| 113 | { |
|
| 114 | $this->queryBuilder |
|
| 115 | ->expects($this->once()) |
|
| 116 | ->method('orWhere') |
|
| 117 | ->with($this->identicalTo($where = 'expression')); |
|
| 118 | ||
| 119 | $this->assertSame($this->builder, $this->builder->orWhere($where)); |
|
| 120 | } |
|
| 121 | ||
| 122 | public function testOrderBy() |
|
| 123 | { |
|
| @@ 122-133 (lines=12) @@ | ||
| 119 | $this->assertSame($this->builder, $this->builder->orWhere($where)); |
|
| 120 | } |
|
| 121 | ||
| 122 | public function testOrderBy() |
|
| 123 | { |
|
| 124 | $this->queryBuilder |
|
| 125 | ->expects($this->once()) |
|
| 126 | ->method('addOrderBy') |
|
| 127 | ->with( |
|
| 128 | $this->identicalTo($sort = 'expression'), |
|
| 129 | $this->identicalTo('ASC') |
|
| 130 | ); |
|
| 131 | ||
| 132 | $this->assertSame($this->builder, $this->builder->orderBy($sort)); |
|
| 133 | } |
|
| 134 | ||
| 135 | public function testOrderByWithOrder() |
|
| 136 | { |
|
| @@ 221-229 (lines=9) @@ | ||
| 218 | $this->assertSame($property, $this->builder->getProperty($field)); |
|
| 219 | } |
|
| 220 | ||
| 221 | public function testAliases() |
|
| 222 | { |
|
| 223 | $this->queryBuilder |
|
| 224 | ->expects($this->once()) |
|
| 225 | ->method('getAllAliases') |
|
| 226 | ->will($this->returnValue($aliases = ['foo'])); |
|
| 227 | ||
| 228 | $this->assertSame($aliases, $this->builder->getAliases()); |
|
| 229 | } |
|
| 230 | ||
| 231 | public function testExpressionBuilder() |
|
| 232 | { |
|