Example #1
0
 public function testFindByContainer()
 {
     // make a container that contains objects for id
     $c = 0;
     while ($c++ < 10) {
         $o = new \stdclass();
         $o->c = $c;
         $objs[$c] = $o;
         $set[] = new EBTC($o, "name-{$c}");
     }
     $container = new Container($set);
     $oneTwoThree = new Container($objs[1], $objs[2], $objs[3]);
     $found = $container->findById($oneTwoThree)->setPropertyMapper();
     $this->assertSame($found->count(), 3);
     $this->assertSame($found->pluck('id')->setPropertyMapper()->pluck('c'), array(1, 2, 3));
 }