1 | <?php |
||
23 | abstract class PHPUnit_Stakx_TestCase extends \PHPUnit_Framework_TestCase |
||
24 | { |
||
25 | const FM_OBJ_TEMPLATE = "---\n%s\n---\n\n%s"; |
||
26 | |||
27 | /** @var string */ |
||
28 | protected $assetFolder; |
||
29 | |||
30 | /** |
||
31 | * @var vfsStreamFile |
||
32 | */ |
||
33 | protected $dummyFile; |
||
34 | |||
35 | /** |
||
36 | * @var vfsStreamDirectory |
||
37 | */ |
||
38 | protected $rootDir; |
||
39 | |||
40 | /** |
||
41 | * @var Filesystem |
||
42 | */ |
||
43 | protected $fs; |
||
44 | |||
45 | public function setUp() |
||
56 | |||
57 | /// |
||
58 | // Assertion functions |
||
59 | /// |
||
60 | |||
61 | protected function assertStringContains($needle, $haystack, $message = '') |
||
65 | |||
66 | protected function assertFileContains($fileContent, $filePath, $message = '') |
||
74 | |||
75 | /// |
||
76 | // Utility Functions |
||
77 | /// |
||
78 | |||
79 | protected function bookCollectionProvider($jailed = false) |
||
92 | |||
93 | /** |
||
94 | * Write a temporary file to the asset folder |
||
95 | * |
||
96 | * @param $fileName |
||
97 | * @param $content |
||
98 | * |
||
99 | * @return string Path to the temporary file; relative to the project's root |
||
100 | */ |
||
101 | protected function createTempFile($fileName, $content) |
||
108 | |||
109 | protected function createBlankFile($filename, $classType, $content) |
||
118 | |||
119 | /** |
||
120 | * @param string $classType |
||
121 | * @param array $frontMatter |
||
122 | * @param string $body |
||
123 | * |
||
124 | * @return mixed |
||
125 | */ |
||
126 | protected function createVirtualFile($classType, $frontMatter = array(), $body = 'Body Text') |
||
134 | |||
135 | protected function createMultipleVirtualFiles($classType, $elements) |
||
154 | |||
155 | /** |
||
156 | * Get a mock logger. |
||
157 | * |
||
158 | * @return LoggerInterface |
||
159 | */ |
||
160 | protected function getMockLogger() |
||
164 | |||
165 | /** |
||
166 | * Get a real logger instance that will save output to the console. |
||
167 | * |
||
168 | * @return StakxLogger |
||
169 | */ |
||
170 | protected function getReadableLogger() |
||
178 | |||
179 | /** |
||
180 | * Generate a FrontMatter-ready syntax to be used as a file's content. |
||
181 | * |
||
182 | * @param array $frontMatter |
||
183 | * @param string $body |
||
184 | * |
||
185 | * @return string |
||
186 | */ |
||
187 | protected function generateFM(array $frontMatter = array(), $body = 'Body text') |
||
193 | |||
194 | /** |
||
195 | * Create a temporary folder where temporary file writes will be made to |
||
196 | * |
||
197 | * Remember to remove the folder in during the ::tearDown() |
||
198 | * |
||
199 | * @param string $folderName |
||
200 | */ |
||
201 | protected function createAssetFolder($folderName) |
||
207 | } |
||
208 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.