Example #1
0
 /**
  * @covers ::assertValid
  */
 public function testAssertValid()
 {
     $model = new Model();
     $model->test = '!!!!';
     $model->assertValid();
     $model->test = null;
     try {
         $model->assertValid();
         $this->fail('Should Throw an exception');
     } catch (InvalidException $exception) {
         $this->assertEquals('Has errors: test must be present', $exception->getMessage());
         $this->assertSame($model, $exception->getSubject());
     }
 }