1 | <?php |
||
18 | abstract class PHPUnit_Stakx_TestCase extends \PHPUnit_Framework_TestCase |
||
|
|||
19 | { |
||
20 | const FM_OBJ_TEMPLATE = "---\n%s\n---\n\n%s"; |
||
21 | |||
22 | /** |
||
23 | * @var vfsStreamFile |
||
24 | */ |
||
25 | protected $dummyFile; |
||
26 | |||
27 | /** |
||
28 | * @var vfsStreamDirectory |
||
29 | */ |
||
30 | protected $rootDir; |
||
31 | |||
32 | /** |
||
33 | * @var Filesystem |
||
34 | */ |
||
35 | protected $fs; |
||
36 | |||
37 | public function setUp() |
||
43 | |||
44 | // |
||
45 | // Assert Functions |
||
46 | // |
||
47 | |||
48 | public function assertFileExistsAndContains ($filePath, $needle, $message = '') |
||
56 | |||
57 | // |
||
58 | // Utility Functions |
||
59 | // |
||
60 | |||
61 | protected function bookCollectionProvider ($jailed = false) |
||
62 | { |
||
63 | $cm = new CollectionManager(); |
||
64 | $cm->setLogger($this->loggerMock()); |
||
65 | $cm->parseCollections(array( |
||
66 | array( |
||
67 | 'name' => 'books', |
||
68 | 'folder' => 'tests/allejo/stakx/Test/assets/MyBookCollection/' |
||
69 | ) |
||
70 | )); |
||
71 | |||
72 | return ($jailed) ? $cm->getCollections() : $cm->getJailedCollections(); |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * @param string $classType |
||
77 | * @param array $frontMatter |
||
78 | * @param string $body |
||
79 | * |
||
80 | * @return mixed |
||
81 | */ |
||
82 | protected function createVirtualFile ($classType, $frontMatter = array(), $body = "Body Text") |
||
92 | |||
93 | protected function createMultipleVirtualFiles ($classType, $elements) |
||
113 | |||
114 | /** |
||
115 | * @return LoggerInterface |
||
116 | */ |
||
117 | protected function loggerMock () |
||
121 | } |
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
.