Beispiel #1
0
 public function testIsSatisfiedByReturnsTrueIfWrappedIsFalse()
 {
     $candidate = new \stdClass();
     $wrappedSpec = $this->createSpecification($candidate, false);
     $spec = new Not($wrappedSpec);
     $this->assertTrue($spec->isSatisfiedBy($candidate));
 }
 public function testBuildReturnsOrxExpressionWithBuildedParts()
 {
     $not = new Not($this->getMock(Specification::class));
     $registry = new Registry();
     $registry->register(get_class($not->getWrappedSpecification()), $this->getMock(Factory::class));
     $qb = $this->getQueryBuilder();
     $exprFirstPart = new Comparison('4', '=', '4');
     $registry->getFactory($not->getWrappedSpecification())->expects($this->any())->method('create')->with($not->getWrappedSpecification(), $qb)->willReturn($exprFirstPart);
     $factory = new NotFactory($registry);
     $expr = $factory->create($not, $qb);
     $this->assertEquals($exprFirstPart, $expr->getArguments()[0]);
 }