Ejemplo n.º 1
0
 public function testGroupEndpoints()
 {
     $parser = new Parser();
     // <stub>
     $endpointsStub = [];
     $groups = ['first', 'second'];
     for ($i = 0; $i < 10; $i++) {
         $endpoint = new Endpoint();
         $endpoint->setGroup($groups[round(rand(0, 1))]);
         $endpointsStub[] = $endpoint;
     }
     // </stub>
     $grouped = $parser->groupEndpoints($endpointsStub);
     $this->assertGreaterThan(1, count($grouped['first']));
     $this->assertGreaterThan(1, count($grouped['second']));
 }