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]); }
public function testConstruction() { $wrapped = $this->getMock('GBProd\\Specification\\Specification'); $spec = new Not($wrapped); $this->assertEquals($wrapped, $spec->getWrappedSpecification()); }