function it_is_initializable() { $this->beConstructedWith(Elevator::createAtFloor(new Floor(5))); $this->shouldHaveType('Bones\\Building\\Elevator\\Controller'); }
/** * Initializes context. * * Every scenario gets its own context instance. * You can also pass arbitrary arguments to the * context constructor through behat.yml. */ public function __construct() { $elevator = Elevator::createAtFloor(new Floor(5)); $this->elevatorController = new ElevatorController($elevator); }
public function pressButtonWithNumber($floorNumber, Resident $resident) { $targetFloor = new Floor($floorNumber); $this->elevator->moveToFloor($targetFloor); $resident->setCurrentFloor($targetFloor); }