Completed
Push — master ( 9e5240...db4f23 )
by
unknown
02:08
created

testNewExceptionWithErrorsArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Passbook\Tests\Exception;
4
5
use Passbook\Exception\PassInvalidException;
6
7
class PassInvalidExceptionTest extends \PHPUnit_Framework_TestCase
8
{
9
    public function testNewExceptionWithoutErrorsArray()
10
    {
11
        $exception = new PassInvalidException();
12
13
        self::assertTrue(is_array($exception->getErrors()));
14
        self::assertEmpty($exception->getErrors());
15
    }
16
17
    public function testNewExceptionWithErrorsArray()
18
    {
19
        $errors = array('error 1', 'error 2');
20
        $exception = new PassInvalidException($errors);
21
22
        self::assertTrue(is_array($exception->getErrors()));
23
        self::assertEquals($errors, $exception->getErrors());
24
    }
25
26
}
27