for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Passbook\Tests\Exception;
use Passbook\Exception\PassInvalidException;
use PHPUnit\Framework\TestCase;
class PassInvalidExceptionTest extends TestCase
{
public function testNewExceptionWithoutErrorsArray()
$exception = new PassInvalidException();
self::assertTrue(is_array($exception->getErrors()));
self::assertEmpty($exception->getErrors());
}
public function testNewExceptionWithErrorsArray()
$errors = ['error 1', 'error 2'];
$exception = new PassInvalidException('', $errors);
self::assertEquals($errors, $exception->getErrors());
public function testNewExceptionWithMessageAndArray()
$exception = new PassInvalidException('Exception message', $errors);
self::assertSame('Exception message', $exception->getMessage());