Exemplo n.º 1
0
 /**
  * @covers ::map
  */
 public function testMap()
 {
     $models = [new City(['id' => 10]), new City(['id' => 20])];
     $link = new LinkMany(new Country(), Country::getRepo()->getRel('cities'), $models);
     $result = $link->map(function ($item) {
         return $item->id;
     });
     $this->assertSame([10, 20], $result);
 }