예제 #1
0
 public function test_indexof()
 {
     $object1 = new stdClass();
     $object2 = new stdClass();
     $collection = new Collection(array(10, 20, array('id' => 30), $object1, $object2));
     $this->assertSame(1, $collection->indexOf(20));
     $this->assertSame(2, $collection->indexOf(array('id?' => 30)));
     $this->assertSame(4, $collection->indexOf($object2));
 }