1 | <?php |
||
22 | class ProxyQueryTest extends TestCase |
||
23 | { |
||
24 | /** |
||
25 | * @var QueryBuilder|\PHPUnit_Framework_MockObject_MockObject |
||
26 | */ |
||
27 | private $qb; |
||
28 | |||
29 | /** |
||
30 | * @var ProxyQuery |
||
31 | */ |
||
32 | private $pq; |
||
33 | |||
34 | public function setUp(): void |
||
35 | { |
||
36 | $this->qb = $this->createMock(QueryBuilder::class); |
||
37 | $this->query = $this->createMock(Query::class); |
||
|
|||
38 | |||
39 | $this->pq = new ProxyQuery($this->qb, 'a'); |
||
40 | } |
||
41 | |||
42 | public function testConstructor(): void |
||
46 | |||
47 | public function testSetSortBy(): void |
||
52 | |||
53 | public function testSetSortOrder(): void |
||
58 | |||
59 | public function testSetSortOrderInvalid(): void |
||
66 | |||
67 | public function testSetFirstResult(): void |
||
75 | |||
76 | public function testGetFirstResult(): void |
||
83 | |||
84 | public function testSetMaxResults(): void |
||
92 | |||
93 | public function testGetMaxResults(): void |
||
100 | |||
101 | public function testExecute(): void |
||
113 | |||
114 | public function testGetAndSetDocumentManager(): void |
||
120 | } |
||
121 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: