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

InvalidGrantExceptionTest::testClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 14
rs 9.4285
cc 1
eloc 10
nc 1
nop 0
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