Ejemplo n.º 1
0
 public function testGetTravellers()
 {
     $elevators = ElevatorsFactory::getElevators(1);
     $this->assertTrue(count($elevators) > 0, "There is more than one elevator");
     foreach ($elevators as $elevator) {
         $this->assertTrue($elevator instanceof Elevator, "Elevator is of the correct type");
         $this->assertTrue(strlen($elevator->name) > 0, "Elevator has name");
     }
 }
Ejemplo n.º 2
0
<?php

namespace Prince\WWW;

require_once __DIR__ . '/../../vendor/autoload.php';
use RobinTheb\Prince\Elevators\ElevatorsFactory;
$levelMachineName = $_POST['levelMachineName'];
print json_encode(ElevatorsFactory::getElevators($levelMachineName));