コード例 #1
0
 public function testSearch()
 {
     $col = new PropelCollection();
     $this->assertFalse($col->search('bar1'), 'search() returns false on an empty collection');
     $data = array('bar1', 'bar2', 'bar3');
     $col = new PropelCollection($data);
     $this->assertEquals(1, $col->search('bar2'), 'search() returns the key when the element exists');
     $this->assertFalse($col->search('bar4'), 'search() returns false when the element does not exist');
 }