function it_builds_a_marking_with_three_place_markings(FactoryInterface $factory, MarkingInterface $marking, PlaceMarkingInterface $placeMarkingOne, PlaceMarkingInterface $placeMarkingTwo, PlaceMarkingInterface $placeMarkingThree, PlaceInterface $placeOne, PlaceInterface $placeTwo, PlaceInterface $placeThree, TokenInterface $token) { $factory->createMarking()->willReturn($marking); $factory->createPlaceMarking()->willReturn($placeMarkingOne, $placeMarkingTwo, $placeMarkingThree); $factory->createToken()->willReturn($token)->shouldBeCalledTimes(3); $marking->setPlaceMarkings(array($placeMarkingOne, $placeMarkingTwo, $placeMarkingThree))->shouldBeCalled(); $placeMarkingOne->setPlace($placeOne)->shouldBeCalled(); $placeMarkingOne->setTokens(array($token))->shouldBeCalled(); $placeMarkingTwo->setPlace($placeTwo)->shouldBeCalled(); $placeMarkingTwo->setTokens(array($token, $token))->shouldBeCalled(); $placeMarkingThree->setPlace($placeThree)->shouldBeCalled(); $placeMarkingThree->setTokens(array($token, $token, $token))->shouldBeCalled(); $this->beConstructedWith($factory); $this->mark($placeOne, $token); $this->mark($placeTwo, array($token, $token)); $this->mark($placeThree, 3); $this->getMarking()->shouldReturn($marking); }
/** * Gets the created marking. * * @return \Petrinet\Model\MarkingInterface */ public function getMarking() { $marking = $this->factory->createMarking(); $marking->setPlaceMarkings($this->placeMarkings); return $marking; }