1 | <?php |
||
17 | abstract class FileLoaderTest extends \PHPUnit_Framework_TestCase |
||
18 | { |
||
19 | /** |
||
20 | * The name of the class to test. |
||
21 | */ |
||
22 | protected $class; |
||
23 | |||
24 | /** |
||
25 | * The extension for the file. |
||
26 | */ |
||
27 | protected $extension; |
||
28 | |||
29 | /** |
||
30 | * The expected result from loading the file. |
||
31 | */ |
||
32 | protected $expected = [ |
||
33 | 'bldr' => [ |
||
34 | 'description' => 'Description for your project', |
||
35 | 'name' => 'acme/demo-project', |
||
36 | 'profiles' => [ |
||
37 | 'default' => [ |
||
38 | 'description' => 'Sample Profile', |
||
39 | 'jobs' => [ |
||
40 | 0 => 'sampleJob', |
||
41 | ], |
||
42 | ], |
||
43 | ], |
||
44 | 'jobs' => [ |
||
45 | 'sampleJob' => [ |
||
46 | 'description' => 'Runs a sleep for 5 seconds, then sends a message to the screen', |
||
47 | 'tasks' => [ |
||
48 | 0 => [ |
||
49 | 'type' => 'sleep', |
||
50 | 'seconds' => 5, |
||
51 | ], |
||
52 | 1 => [ |
||
53 | 'type' => 'notify', |
||
54 | 'message' => 'Finished Sleeping. Ending now.' |
||
55 | ], |
||
56 | ], |
||
57 | ], |
||
58 | ] |
||
59 | ], |
||
60 | ]; |
||
61 | |||
62 | /** |
||
63 | * Set up the FileLoader. |
||
64 | */ |
||
65 | public function setUp() |
||
77 | |||
78 | /** |
||
79 | * Tests the protected loadFile() function from the FileLoader. |
||
80 | */ |
||
81 | public function testLoadFile() |
||
88 | |||
89 | /** |
||
90 | * Tests the getFileExtension function. |
||
91 | */ |
||
92 | public function testGetFileExtension() |
||
97 | |||
98 | /** |
||
99 | * Invoke a protected or private method from a class. |
||
100 | */ |
||
101 | private function invokeMethod(&$object, $methodName, array $parameters = []) |
||
109 | } |
||
110 |