Ejemplo n.º 1
0
 public function testModelExposesHiddenFields()
 {
     $model = new RealModelStub(['myField' => 'value', 'anotherField' => 'yeah', 'someField' => 'whatever', 'hiddenField' => 'secrets!', 'passwordHash' => '1234']);
     $hidden = $model->withHidden(['hiddenField', 'passwordHash'])->toArray();
     $this->assertTrue(isset($hidden['hiddenField']));
     $this->assertTrue(isset($hidden['passwordHash']));
     $this->assertEquals('secrets!', $hidden['hiddenField']);
     $this->assertEquals('1234', $hidden['passwordHash']);
 }