These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace Redaxscript\Tests; |
||
3 | |||
4 | /** |
||
5 | * SingletonTest |
||
6 | * |
||
7 | * @since 2.2.0 |
||
8 | * |
||
9 | * @package Redaxscript |
||
10 | * @category Tests |
||
11 | * @author Henry Ruhs |
||
12 | * |
||
13 | * @covers Redaxscript\Singleton |
||
14 | */ |
||
15 | |||
16 | class SingletonTest extends TestCaseAbstract |
||
17 | { |
||
18 | /** |
||
19 | * testGetInstance |
||
20 | * |
||
21 | * @since 3.0.0 |
||
22 | */ |
||
23 | |||
24 | public function testGetInstance() : void |
||
25 | { |
||
26 | /* setup */ |
||
27 | |||
28 | $stub = $this->getMockBuilder('Redaxscript\Singleton')->disableOriginalConstructor()->getMockForAbstractClass(); |
||
29 | |||
30 | /* actual */ |
||
31 | |||
32 | $actual = $stub->getInstance(); |
||
0 ignored issues
–
show
|
|||
33 | |||
34 | /* compare */ |
||
35 | |||
36 | $this->assertInstanceOf('Redaxscript\Singleton', $actual); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * testClearInstance |
||
41 | * |
||
42 | * @since 3.0.0 |
||
43 | */ |
||
44 | |||
45 | public function testClearInstance() : void |
||
46 | { |
||
47 | /* setup */ |
||
48 | |||
49 | $stub = $this->getMockBuilder('Redaxscript\Singleton')->disableOriginalConstructor()->getMockForAbstractClass(); |
||
50 | $stub->clearInstance(); |
||
0 ignored issues
–
show
The method
clearInstance() does not seem to exist on object<PHPUnit\Framework\MockObject\MockObject> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed.
Loading history...
|
|||
51 | |||
52 | /* actual */ |
||
53 | |||
54 | $actual = $stub->getInstance(); |
||
0 ignored issues
–
show
The method
getInstance() does not seem to exist on object<PHPUnit\Framework\MockObject\MockObject> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed.
Loading history...
|
|||
55 | |||
56 | /* compare */ |
||
57 | |||
58 | $this->assertNull($actual); |
||
59 | } |
||
60 | } |
||
61 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.