| Conditions | 1 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public function testOnBeforeSearch() |
||
| 15 | { |
||
| 16 | $object = new \CircleCITestIndex(); |
||
| 17 | $extension = new BaseIndexExtension(); |
||
| 18 | $extension->setOwner($object); |
||
| 19 | |||
| 20 | $query = new BaseQuery(); |
||
| 21 | $clientQuery = new Query(); |
||
| 22 | |||
| 23 | $extension->onBeforeSearch($query, $clientQuery); |
||
| 24 | |||
| 25 | $this->assertEquals(['MemberView' => ['null']], $query->getFilter()); |
||
| 26 | |||
| 27 | $member = (new DefaultAdminService())->findOrCreateDefaultAdmin(); |
||
|
|
|||
| 28 | $this->logInAs($member); |
||
| 29 | |||
| 30 | $query = new BaseQuery(); |
||
| 31 | $clientQuery = new Query(); |
||
| 32 | |||
| 33 | $extension->onBeforeSearch($query, $clientQuery); |
||
| 34 | |||
| 35 | $this->assertContains('1-' . $member->ID, $query->getFilter()['MemberView']); |
||
| 36 | |||
| 37 | $filterQueries = $clientQuery->getFilterQueries(); |
||
| 38 | |||
| 39 | $this->assertFalse(array_key_exists('ViewStatus', $filterQueries)); |
||
| 40 | } |
||
| 42 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.