Code Duplication    Length = 15-15 lines in 2 locations

tests/ElasticaSpecification/ExpressionBuilder/AndXBuilderTest.php 1 location

@@ 23-37 (lines=15) @@
20
        $this->assertInstanceOf(AndXBuilder::class, $builder);
21
    }
22
23
    public function testBuildReturnsAndxExpression()
24
    {
25
        $andx = $this->createAndX();
26
        $registry = $this->createRegistry($andx);
27
28
        $builder = new AndXBuilder($registry);
29
30
        $query = $builder->build($andx, new QueryBuilder());
31
32
        $this->assertInstanceOf(BoolQuery::class, $query);
33
34
        $this->assertArrayHasKey('bool', $query->toArray());
35
        $this->assertArrayHasKey('must', $query->toArray()['bool']);
36
        $this->assertCount(2, $query->toArray()['bool']['must']);
37
    }
38
39
    /**
40
     * @return AndX

tests/ElasticaSpecification/ExpressionBuilder/NotBuilderTest.php 1 location

@@ 23-37 (lines=15) @@
20
        $this->assertInstanceOf(NotBuilder::class, $builder);
21
    }
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