File tree Expand file tree Collapse file tree 3 files changed +43
-2
lines changed
tests/phpbu/Configuration Expand file tree Collapse file tree 3 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -332,7 +332,7 @@ private function handleConfigGeneration()
332332
333333 \file_put_contents (
334334 $ file ,
335- $ generator ->generateDefaultConfiguration (
335+ $ generator ->generateConfigurationSkeleton (
336336 Version::minor (),
337337 $ format ,
338338 $ bootstrapScript
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ final class Generator
7474 * @param string $bootstrapScript
7575 * @return string
7676 */
77- public function generateDefaultConfiguration (string $ version , string $ format , string $ bootstrapScript ) : string
77+ public function generateConfigurationSkeleton (string $ version , string $ format , string $ bootstrapScript ) : string
7878 {
7979 return \str_replace (
8080 [
Original file line number Diff line number Diff line change 1+ <?php
2+ namespace phpbu \App \Configuration ;
3+
4+ use PHPUnit \Framework \TestCase ;
5+
6+ /**
7+ * Generator test
8+ *
9+ * @package phpbu
10+ * @subpackage tests
11+ * @author Sebastian Feldmann <sebastian@phpbu.de>
12+ * @copyright Sebastian Feldmann <sebastian@phpbu.de>
13+ * @license https://opensource.org/licenses/MIT The MIT License (MIT)
14+ * @link http://www.phpbu.de/
15+ * @since Class available since Release 6.0.0
16+ */
17+ class GeneratorTest extends TestCase
18+ {
19+ /**
20+ * Tests Generator::generateConfigurationSkeleton
21+ */
22+ public function testGenerateConfigurationSkeletonXml ()
23+ {
24+ $ generator = new Generator ();
25+ $ config = $ generator ->generateConfigurationSkeleton ('X.Y ' , 'xml ' , 'boot.php ' );
26+
27+ $ this ->assertContains ('bootstrap="boot.php" ' , $ config );
28+ $ this ->assertContains ('xsi:noNamespaceSchemaLocation="https://schema.phpbu.de/X.Y/phpbu.xsd" ' , $ config );
29+ }
30+
31+ /**
32+ * Tests Generator::generateConfigurationSkeleton
33+ */
34+ public function testGenerateConfigurationSkeletonJson ()
35+ {
36+ $ generator = new Generator ();
37+ $ config = $ generator ->generateConfigurationSkeleton ('X.Y ' , 'json ' , 'boot.php ' );
38+
39+ $ this ->assertContains ('"bootstrap": "boot.php" ' , $ config );
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments