コード例 #1
0
 public function testFillable()
 {
     $model = new EloquentModelStub();
     $model->setFillable(array('name', 'age'));
     $model->fill(array('name' => 'foo', 'age' => 'bar', 'password' => 'baz'));
     $this->assertFalse(isset($model->password));
     $this->assertEquals('foo', $model->name);
     $this->assertEquals('bar', $model->age);
 }
コード例 #2
0
 public function testIsWithAnotherConnection()
 {
     $firstInstance = new EloquentModelStub(['id' => 1]);
     $secondInstance = new EloquentModelStub(['id' => 1]);
     $secondInstance->setConnection('foo');
     $result = $firstInstance->is($secondInstance);
     $this->assertFalse($result);
 }