1 | <?php |
||
48 | class RepositoryTest extends AbstractTest |
||
49 | { |
||
50 | /** |
||
51 | * Tears down the fixture |
||
52 | */ |
||
53 | public function tearDown() |
||
59 | |||
60 | /** |
||
61 | * Test the generation of a test repository |
||
62 | * |
||
63 | * @expectedException \Apparat\Dev\Ports\InvalidArgumentsException |
||
64 | * @expectedExceptionCode 1464974472 |
||
65 | */ |
||
66 | public function testGenerateRepositoryInvalidRoot() |
||
70 | |||
71 | /** |
||
72 | * Test the generation of a test repository with an empty object configuration |
||
73 | * |
||
74 | * @expectedException \Apparat\Dev\Ports\InvalidArgumentsException |
||
75 | * @expectedExceptionCode 1464974779 |
||
76 | */ |
||
77 | public function testGenerateRepositoryInvalidObjectConfig() |
||
81 | |||
82 | /** |
||
83 | * Test the generation of a test repository with zero object count |
||
84 | * |
||
85 | * @expectedException \Apparat\Dev\Ports\InvalidArgumentsException |
||
86 | * @expectedExceptionCode 1464975382 |
||
87 | */ |
||
88 | public function testGenerateRepositoryEmptyObjectCount() |
||
99 | |||
100 | /** |
||
101 | * Test the generation of a test repository |
||
102 | */ |
||
103 | public function testGenerateRepositoryEmptyFiles() |
||
122 | |||
123 | /** |
||
124 | * Test the repository generation with failing mkdir() |
||
125 | * |
||
126 | * @expectedException \Apparat\Dev\Ports\RuntimeException |
||
127 | * @expectedExceptionCode 1464997310 |
||
128 | */ |
||
129 | public function testGenerateRepositoryFailingMkdir() |
||
134 | |||
135 | /** |
||
136 | * Test the repository generation with failing touch() |
||
137 | * |
||
138 | * @expectedException \Apparat\Dev\Ports\RuntimeException |
||
139 | * @expectedExceptionCode 1464997761 |
||
140 | */ |
||
141 | public function testGenerateRepositoryFailingTouch() |
||
146 | |||
147 | /** |
||
148 | * Test the generation of a test repository |
||
149 | */ |
||
150 | // public function testGenerateRepository() |
||
151 | // { |
||
152 | // $objectConfig = [ |
||
153 | // Object::ARTICLE => [ |
||
154 | // Repository::COUNT => 10, |
||
155 | // Repository::HIDDEN => .5, |
||
156 | // Repository::DRAFTS => .2, |
||
157 | // ], |
||
158 | // ]; |
||
159 | // $this->generateAndTestRepository($objectConfig, 10, false); |
||
160 | // } |
||
161 | |||
162 | /** |
||
163 | * Generate and test a repository |
||
164 | * |
||
165 | * @param array $objectConfig Object configuration |
||
166 | * @param int $expectedCount Expected number of objects |
||
167 | * @param bool $emptyFiles Create empty files |
||
168 | */ |
||
169 | protected function generateAndTestRepository(array $objectConfig, $expectedCount, $emptyFiles = false) |
||
181 | } |
||
182 | } |
||
212 |