Completed
Pull Request — release-v2.1 (#15)
by Quentin
08:46 queued 01:14
created

InvalidGrantExceptionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testClass() 0 14 1
1
<?php
2
3
namespace Majora\Component\OAuth\Tests\Exception;
4
5
use Majora\Component\OAuth\Entity\LoginAttempt;
6
use Majora\Component\OAuth\Exception\InvalidGrantException;
7
8
/**
9
 * Unit test class for Majora\Component\OAuth\Exception\InvalidGrantException.
10
 */
11
class InvalidGrantExceptionTest extends \PHPUnit_Framework_TestCase
12
{
13
    /**
14
     * Tests all class methods.
15
     */
16
    public function testClass()
17
    {
18
        $exception = new InvalidGrantException(
19
            $loginAttempt = $this->prophesize(LoginAttempt::class)->reveal(),
20
            $message = 'Fake exception',
21
            $code = 666,
22
            $previous = new \Exception()
23
        );
24
25
        $this->assertSame($loginAttempt, $exception->getLoginAttempt());
26
        $this->assertEquals($message, $exception->getMessage());
27
        $this->assertEquals($code, $exception->getCode());
28
        $this->assertSame($previous, $exception->getPrevious());
29
    }
30
}
31