Doctrine\Tests\ODM\PHPCR\Query\Builder\ConverterPhpcrTest::testDispatchCompositeConstraints PHP Метод

testDispatchCompositeConstraints() публичный Метод

public testDispatchCompositeConstraints ( $method, $expectedClass, $nbConstraints )
    public function testDispatchCompositeConstraints($method, $expectedClass, $nbConstraints)
    {
        $this->primeBuilder();
        $where = $this->qb->where();
        $composite = $where->{$method}();
        for ($i = 0; $i < $nbConstraints; $i++) {
            $composite->fieldIsset('alias_1.prop_2');
        }
        $res = $this->converter->dispatch($where);
        $this->assertInstanceOf($expectedClass, $res);
        if ($nbConstraints == 2) {
            $this->assertInstanceOf('PHPCR\\Query\\QOM\\PropertyExistenceInterface', $res->getConstraint1());
            $this->assertInstanceOf('PHPCR\\Query\\QOM\\PropertyExistenceInterface', $res->getConstraint2());
        } elseif ($nbConstraints > 2) {
            $this->assertInstanceOf($expectedClass, $res->getConstraint1());
            $this->assertInstanceOf('PHPCR\\Query\\QOM\\PropertyExistenceInterface', $res->getConstraint2());
        }
    }