public static function extractId() { return function ($object) { /** @var \Ouzo\Model $object */ return $object->getId(); }; }
/** * @test */ public function shouldExtractId() { //given $product = new Product(array('id' => 1)); //when $id = Functions::call(Functions::extractId(), $product); //then $this->assertEquals(1, $id); }