function it_marks_a_place_with_the_specified_tokens_number(FactoryInterface $factory, TokenInterface $token, PlaceInterface $place, PlaceMarkingInterface $placeMarking) { $placeMarking->setTokens(array($token, $token, $token))->shouldBeCalled(); $placeMarking->setPlace($place)->shouldBeCalled(); $factory->createPlaceMarking()->willReturn($placeMarking); $factory->createToken()->willReturn($token)->shouldBeCalledTimes(3); $this->beConstructedWith($factory); $this->mark($place, 3)->shouldReturn($this); }