Inheritance: extends lithium\data\Collection
Ejemplo n.º 1
0
 public function testHandlers()
 {
     $handlers = array('stdClass' => function ($value) {
         return substr($value->scalar, -1);
     });
     $array = new MockCollection(compact('handlers') + array('data' => array(array('value' => (object) 'hello'), array('value' => (object) 'world'))));
     $expected = array(array('value' => 'o'), array('value' => 'd'));
     $this->assertIdentical($expected, $array->to('array', array('indexed' => false)));
 }