| 1 | <?php |
||
| 8 | class PassInvalidExceptionTest extends TestCase |
||
| 9 | { |
||
| 10 | public function testNewExceptionWithoutErrorsArray() |
||
| 11 | { |
||
| 12 | $exception = new PassInvalidException(); |
||
| 13 | |||
| 14 | self::assertTrue(is_array($exception->getErrors())); |
||
| 15 | self::assertEmpty($exception->getErrors()); |
||
| 16 | } |
||
| 17 | |||
| 18 | public function testNewExceptionWithErrorsArray() |
||
| 19 | { |
||
| 20 | $errors = array('error 1', 'error 2'); |
||
| 21 | $exception = new PassInvalidException('', $errors); |
||
| 22 | |||
| 23 | self::assertTrue(is_array($exception->getErrors())); |
||
| 24 | self::assertEquals($errors, $exception->getErrors()); |
||
| 25 | } |
||
| 26 | |||
| 27 | public function testNewExceptionWithMessageAndArray() |
||
| 28 | { |
||
| 29 | $errors = array('error 1', 'error 2'); |
||
| 30 | $exception = new PassInvalidException('Exception message', $errors); |
||
| 31 | |||
| 32 | self::assertTrue(is_array($exception->getErrors())); |
||
| 33 | self::assertEquals($errors, $exception->getErrors()); |
||
| 34 | self::assertSame('Exception message', $exception->getMessage()); |
||
| 35 | } |
||
| 36 | |||
| 37 | } |
||
| 38 |