1 | <?php |
||
14 | class NotBuilderTest extends \PHPUnit_Framework_TestCase |
||
15 | { |
||
16 | public function testConstruct() |
||
22 | |||
23 | public function testBuildReturnsNotExpression() |
||
24 | { |
||
25 | $not = $this->createNot(); |
||
26 | $registry = $this->createRegistry($not); |
||
27 | |||
28 | $builder = new NotBuilder($registry); |
||
29 | |||
30 | $query = $builder->build($not, new QueryBuilder()); |
||
31 | |||
32 | $this->assertInstanceOf(BoolQuery::class, $query); |
||
33 | |||
34 | $this->assertArrayHasKey('bool', $query->toArray()); |
||
35 | $this->assertArrayHasKey('must_not', $query->toArray()['bool']); |
||
36 | $this->assertCount(1, $query->toArray()['bool']['must_not']); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @return Not |
||
41 | */ |
||
42 | private function createNot() |
||
48 | |||
49 | /** |
||
50 | * @param Not $not |
||
51 | * |
||
52 | * @return Registry |
||
53 | */ |
||
54 | private function createRegistry($not) |
||
69 | |||
70 | |||
71 | public function testBuildThrowExceptionIfNotNotSpecification() |
||
81 | } |
||
82 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.