1 | <?php |
||
20 | abstract class PHPUnit_Stakx_TestCase extends \PHPUnit_Framework_TestCase |
||
|
|||
21 | { |
||
22 | const FM_OBJ_TEMPLATE = "---\n%s\n---\n\n%s"; |
||
23 | |||
24 | /** |
||
25 | * @var vfsStreamFile |
||
26 | */ |
||
27 | protected $dummyFile; |
||
28 | |||
29 | /** |
||
30 | * @var vfsStreamDirectory |
||
31 | */ |
||
32 | protected $rootDir; |
||
33 | |||
34 | /** |
||
35 | * @var Filesystem |
||
36 | */ |
||
37 | protected $fs; |
||
38 | |||
39 | public function setUp() |
||
48 | |||
49 | /// |
||
50 | // Assertion functions |
||
51 | /// |
||
52 | |||
53 | protected function assertStringContains($needle, $haystack, $message = '') |
||
57 | |||
58 | protected function assertFileContains($fileContent, $filePath, $message = '') |
||
66 | |||
67 | // |
||
68 | // Utility Functions |
||
69 | // |
||
70 | |||
71 | protected function bookCollectionProvider($jailed = false) |
||
84 | |||
85 | /** |
||
86 | * @param string $classType |
||
87 | * @param array $frontMatter |
||
88 | * @param string $body |
||
89 | * |
||
90 | * @return mixed |
||
91 | */ |
||
92 | protected function createVirtualFile($classType, $frontMatter = array(), $body = 'Body Text') |
||
100 | |||
101 | protected function createMultipleVirtualFiles($classType, $elements) |
||
120 | |||
121 | /** |
||
122 | * Get a mock logger. |
||
123 | * |
||
124 | * @return LoggerInterface |
||
125 | */ |
||
126 | protected function getMockLogger() |
||
130 | |||
131 | /** |
||
132 | * Get a real logger instance that will save output to the console. |
||
133 | * |
||
134 | * @return StakxLogger |
||
135 | */ |
||
136 | protected function getReadableLogger() |
||
144 | |||
145 | /** |
||
146 | * Generate a FrontMatter-ready syntax to be used as a file's content. |
||
147 | * |
||
148 | * @param array $frontMatter |
||
149 | * @param string $body |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | protected function generateFM(array $frontMatter = array(), $body = 'Body text') |
||
159 | } |
||
160 |
Classes in PHP are usually named in CamelCase.
In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well.
Thus the name database provider becomes
DatabaseProvider
.