Пример #1
0
 public function testGetObjectList()
 {
     $structure = new Structure(array('param1' => array(array('param1' => 'value1', 'param2' => 'value2'), array('param1' => 'value3', 'param2' => 'value4'))));
     $this->assertEquals('value2', $structure->getObjectList('param1')->current()->param2);
 }
Пример #2
0
 /**
  * @expectedException \Sokil\Mongo\Exception
  * @expectedExceptionMessage Wrong class name specified. Use string or closure
  */
 public function testGetObjectList_ClassNotClosureAndValidClassName()
 {
     $structure = new Structure();
     $structure->set('param1', 'value1');
     $structure->set('param2', array(array('a' => 'a1')));
     // get object
     $structure->getObjectList('param2', 42);
 }