Ejemplo n.º 1
0
 /**
  * Call a method on each of the models, return the results as an array
  *
  * @param  string $methodName
  * @return array
  */
 public function invoke($methodName)
 {
     return $this->current->invoke($methodName);
 }
Ejemplo n.º 2
0
 /**
  * @covers ::invoke
  */
 public function testInvoke()
 {
     $source = [new City(['id' => 1]), new City(['id' => 1]), new City(['id' => 2])];
     $models = new Models($source);
     $result = $models->invoke('getId');
     $this->assertEquals([1, 1, 2], $result);
 }