UndefinedExtractorExceptionTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 11
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace OAuth\Unit\UserData\Exception;
4
5
use OAuth\UserData\Exception\UndefinedExtractorException;
6
7
/**
8
 * Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2014-02-08 at 00:28:02.
9
 */
10
class UndefinedExtractorExceptionTest extends \PHPUnit_Framework_TestCase
11
{
12
    /**
13
     * @var UndefinedExtractorException
14
     */
15
    protected $exception;
16
17
    protected $service;
18
19
    /**
20
     * Sets up the fixture, for example, opens a network connection.
21
     * This method is called before a test is executed.
22
     */
23
    protected function setUp()
24
    {
25
        $this->service = $this->getMockBuilder('\\OAuth\\Common\\Service\\ServiceInterface')
26
            ->setMockClassName('SomeClass')
27
            ->getMock();
28
        /**
29
         * @var \OAuth\Common\Service\ServiceInterface $service
30
         */
31
        $service = $this->service;
32
        $this->exception = new UndefinedExtractorException($service, array('foo', 'bar'));
33
    }
34
35
    /**
36
     * Tears down the fixture, for example, closes a network connection.
37
     * This method is called after a test is executed.
38
     */
39
    protected function tearDown()
40
    {
41
    }
42
43
    public function testGetService()
44
    {
45
        $this->assertSame($this->service, $this->exception->getService());
46
    }
47
48
    public function testGetRegisteredExtractors()
49
    {
50
        $this->assertEquals(array('foo', 'bar'), $this->exception->getRegisteredExtractors());
51
    }
52
53
    public function testGetMessageWithCustomMessage()
54
    {
55
        $exception = new UndefinedExtractorException($this->service, array(), 'some message');
56
        $this->assertEquals('some message', $exception->getMessage());
57
    }
58
}
59