File tree Expand file tree Collapse file tree 3 files changed +10
-13
lines changed Expand file tree Collapse file tree 3 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 4
4
5
5
use Art4 \JsonApiClient \Exception \FactoryException ;
6
6
7
- class Factory implements FactoryInterface
7
+ final class Factory implements FactoryInterface
8
8
{
9
9
/**
10
10
* @var array
Original file line number Diff line number Diff line change 2
2
3
3
namespace Art4 \JsonApiClient \Tests \Fixtures ;
4
4
5
- use Art4 \JsonApiClient \Utils \Factory as OrigFactory ;
5
+ use Art4 \JsonApiClient \Utils \FactoryInterface ;
6
6
7
- class Factory extends OrigFactory
7
+ final class Factory implements FactoryInterface
8
8
{
9
9
public $ testcase ;
10
10
@@ -17,11 +17,8 @@ class Factory extends OrigFactory
17
17
*/
18
18
public function make ($ name , array $ args = [])
19
19
{
20
- if ( isset ($ this ->classes [$ name ]) )
21
- {
22
- return $ this ->testcase
23
- ->getMockBuilder ($ this ->classes [$ name ] . 'Interface ' ) // Mock only the interfaces
24
- ->getMock ();
25
- }
20
+ return $ this ->testcase
21
+ ->getMockBuilder ('Art4\JsonApiClient \\' . $ name . 'Interface ' ) // Mock only the interfaces
22
+ ->getMock ();
26
23
}
27
24
}
Original file line number Diff line number Diff line change @@ -22,23 +22,23 @@ public function testCreateReturnsSelf()
22
22
*/
23
23
public function testCreateWithConstructorReturnsSelf ()
24
24
{
25
- $ factory = $ this ->getMockBuilder ('Art4\JsonApiClient\Utils\Factory ' )
25
+ $ factory = $ this ->getMockBuilder ('Art4\JsonApiClient\Utils\FactoryInterface ' )
26
26
->getMock ();
27
27
28
28
$ manager = new Manager ($ factory );
29
29
30
30
$ this ->assertInstanceOf ('Art4\JsonApiClient\Utils\ManagerInterface ' , $ manager );
31
31
$ this ->assertInstanceOf ('Art4\JsonApiClient\Utils\FactoryManagerInterface ' , $ manager );
32
32
33
- $ this ->assertSame ( $ factory , $ manager ->getFactory ());
33
+ $ this ->assertInstanceOf ( ' Art4\JsonApiClient\Utils\FactoryInterface ' , $ manager ->getFactory ());
34
34
}
35
35
36
36
/**
37
37
* @test
38
38
*/
39
39
public function testSetFactoryReturnsSelf ()
40
40
{
41
- $ factory = $ this ->getMockBuilder ('Art4\JsonApiClient\Utils\Factory ' )
41
+ $ factory = $ this ->getMockBuilder ('Art4\JsonApiClient\Utils\FactoryInterface ' )
42
42
->getMock ();
43
43
44
44
$ manager = new Manager ;
@@ -51,7 +51,7 @@ public function testSetFactoryReturnsSelf()
51
51
*/
52
52
public function testGetFactoryReturnsFactoryInterface ()
53
53
{
54
- $ factory = $ this ->getMockBuilder ('Art4\JsonApiClient\Utils\Factory ' )
54
+ $ factory = $ this ->getMockBuilder ('Art4\JsonApiClient\Utils\FactoryInterface ' )
55
55
->getMock ();
56
56
57
57
$ manager = (new Manager )->setFactory ($ factory );
You can’t perform that action at this time.
0 commit comments