1 | <?php |
||
10 | class ExtractorFactoryTest extends \PHPUnit_Framework_TestCase |
||
11 | { |
||
12 | /** |
||
13 | * @var ExtractorFactory |
||
14 | */ |
||
15 | protected $factory; |
||
16 | |||
17 | /** |
||
18 | * Sets up the fixture, for example, opens a network connection. |
||
19 | * This method is called before a test is executed. |
||
20 | */ |
||
21 | protected function setUp() |
||
25 | |||
26 | /** |
||
27 | * Tears down the fixture, for example, closes a network connection. |
||
28 | * This method is called after a test is executed. |
||
29 | */ |
||
30 | protected function tearDown() |
||
33 | |||
34 | /** |
||
35 | * @covers \OAuth\UserData\ExtractorFactory |
||
36 | */ |
||
37 | public function testImplementsExtractorFactoryInterface() |
||
41 | |||
42 | /** |
||
43 | * @covers \OAuth\UserData\ExtractorFactory |
||
44 | */ |
||
45 | public function testGetMappedExtractor() |
||
55 | |||
56 | /** |
||
57 | * @covers \OAuth\UserData\ExtractorFactory |
||
58 | */ |
||
59 | public function testGetUnmappedExtractor() |
||
68 | |||
69 | /** |
||
70 | * @covers \OAuth\UserData\ExtractorFactory |
||
71 | * @expectedException \OAuth\UserData\Exception\UndefinedExtractorException |
||
72 | * @expectedExceptionMessage Cannot find an extractor for the service "FakeService". Registered extractors: [] |
||
73 | */ |
||
74 | public function testGetThrowsUnmatchedExtractorException() |
||
82 | |||
83 | /** |
||
84 | * @covers \OAuth\UserData\ExtractorFactory |
||
85 | * @expectedException \OAuth\UserData\Exception\InvalidExtractorException |
||
86 | * @expectedExceptionMessage The class "stdClass" does not implement the interface OAuth\UserData\Extractor\ExtractorInterface |
||
87 | */ |
||
88 | public function testGetThrowsInvalidExtractorException() |
||
97 | } |
||
98 |