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 | use Redaxscript\Autoloader; |
||
5 | use function class_exists; |
||
6 | |||
7 | /** |
||
8 | * AutoloaderTest |
||
9 | * |
||
10 | * @since 2.1.0 |
||
11 | * |
||
12 | * @package Redaxscript |
||
13 | * @category Tests |
||
14 | * @author Henry Ruhs |
||
15 | * @author Sven Weingartner |
||
16 | * |
||
17 | * @covers Redaxscript\Autoloader |
||
18 | */ |
||
19 | |||
20 | class AutoloaderTest extends TestCaseAbstract |
||
21 | { |
||
22 | /** |
||
23 | * testInit |
||
24 | * |
||
25 | * @since 3.0.0 |
||
26 | */ |
||
27 | |||
28 | public function testInit() |
||
29 | { |
||
30 | /* setup */ |
||
31 | |||
32 | $autoloader = new Autoloader(); |
||
33 | $autoloader->init('test'); |
||
34 | |||
35 | /* actual */ |
||
36 | |||
37 | $actualArray = $this->readAttribute($autoloader, '_autoloadArray'); |
||
0 ignored issues
–
show
|
|||
38 | |||
39 | /* compare */ |
||
40 | |||
41 | $this->assertEquals('test', $actualArray[0]); |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * testFilePath |
||
46 | * |
||
47 | * @since 2.2.0 |
||
48 | * |
||
49 | * @param string $className |
||
50 | * @param string $expect |
||
51 | * |
||
52 | * @dataProvider providerAutoloader |
||
53 | */ |
||
54 | |||
55 | public function testFilePath(string $className = null, string $expect = null) |
||
56 | { |
||
57 | /* actual */ |
||
58 | |||
59 | $actual = class_exists($className); |
||
60 | |||
61 | /* compare */ |
||
62 | |||
63 | $this->assertEquals($expect, $actual); |
||
64 | } |
||
65 | } |
||
66 | |||
67 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.