示例#1
0
 public function testCanCastModelToArray()
 {
     $model = new DummyToArray(array('user' => new DummyToArray(array('name' => 'foo'))));
     $populator = new Populator($model);
     $this->assertEquals('foo', $populator->get('user.name'));
 }
示例#2
0
文件: Form.php 项目: aleguisf/fvdev1
 /**
  * Populate a form with specific values
  *
  * @param array|object $values
  *
  * @return $this
  */
 public function populate($values)
 {
     $this->populator->replace($values);
     return $this;
 }
示例#3
0
 public function testCanGetClassNamesImplementingToArray()
 {
     $populator = new Populator(array('foo' => '\\Former\\Dummy\\DummyEloquent'));
     $this->assertEquals('\\Former\\Dummy\\DummyEloquent', $populator->get('foo[0]'));
 }