예제 #1
0
 public function testFillable()
 {
     $model = new LMongoModelStub();
     $model->fillable(array('name', 'age'));
     $model->fill(array('name' => 'foo', 'age' => 'bar'));
     $this->assertEquals('foo', $model->name);
     $this->assertEquals('bar', $model->age);
 }
예제 #2
0
 public function testFillableOverridesGuarded()
 {
     $model = new LMongoModelStub();
     $model->guard(array('name', 'age'));
     $model->fillable(array('age', 'foo'));
     $model->fill(array('name' => 'foo', 'age' => 'bar', 'foo' => 'bar'));
     $this->assertFalse(isset($model->name));
     $this->assertEquals('bar', $model->age);
     $this->assertEquals('bar', $model->foo);
 }