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

PassInvalidExceptionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testNewExceptionWithoutErrorsArray() 0 7 1
A testNewExceptionWithErrorsArray() 0 8 1
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