/** * @covers ::invoke */ public function testInvoke() { $source = [new Model(['name' => 'test1']), new Model(['name' => 'test1']), new Model(['name' => 'test2'])]; $models = new Models($source); $result = $models->invoke('getName'); $this->assertEquals(['test1', 'test1', 'test2'], $result); }
/** * 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); }