@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | class MozartIssue130Test extends \BrianHenryIE\Strauss\Tests\Integration\Util\IntegrationTestCase |
23 | 23 | { |
24 | 24 | |
25 | - /** |
|
26 | - * @author BrianHenryIE |
|
27 | - */ |
|
28 | - public function test_config_copied() |
|
29 | - { |
|
25 | + /** |
|
26 | + * @author BrianHenryIE |
|
27 | + */ |
|
28 | + public function test_config_copied() |
|
29 | + { |
|
30 | 30 | |
31 | - $composerJsonString = <<<'EOD' |
|
31 | + $composerJsonString = <<<'EOD' |
|
32 | 32 | { |
33 | 33 | "name": "brianhenryie/mozart-issue-130", |
34 | 34 | "require": { |
@@ -56,19 +56,19 @@ discard block |
||
56 | 56 | } |
57 | 57 | EOD; |
58 | 58 | |
59 | - file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
59 | + file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
60 | 60 | |
61 | - chdir($this->testsWorkingDir); |
|
61 | + chdir($this->testsWorkingDir); |
|
62 | 62 | |
63 | - exec('composer install'); |
|
63 | + exec('composer install'); |
|
64 | 64 | |
65 | - $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
66 | - $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
65 | + $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
66 | + $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
67 | 67 | |
68 | - $mozartCompose = new Compose(); |
|
68 | + $mozartCompose = new Compose(); |
|
69 | 69 | |
70 | - $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
70 | + $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
71 | 71 | |
72 | - $this->assertFileExists($this->testsWorkingDir .'strauss/htmlburger/carbon-fields/config.php'); |
|
73 | - } |
|
72 | + $this->assertFileExists($this->testsWorkingDir .'strauss/htmlburger/carbon-fields/config.php'); |
|
73 | + } |
|
74 | 74 | } |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | class MozartIssue128Test extends IntegrationTestCase |
19 | 19 | { |
20 | 20 | |
21 | - /** |
|
22 | - * Because the neither package was a sub-package of the other, the replacing was not occurring |
|
23 | - * throughout. |
|
24 | - */ |
|
25 | - public function test_it_does_not_make_classname_replacement_inside_namespaced_file() |
|
26 | - { |
|
21 | + /** |
|
22 | + * Because the neither package was a sub-package of the other, the replacing was not occurring |
|
23 | + * throughout. |
|
24 | + */ |
|
25 | + public function test_it_does_not_make_classname_replacement_inside_namespaced_file() |
|
26 | + { |
|
27 | 27 | |
28 | - $this->markTestSkipped("Failing on PHP 8"); |
|
28 | + $this->markTestSkipped("Failing on PHP 8"); |
|
29 | 29 | |
30 | - $composerJsonString = <<<'EOD' |
|
30 | + $composerJsonString = <<<'EOD' |
|
31 | 31 | { |
32 | 32 | "require": { |
33 | 33 | "setasign/fpdf": "1.8", |
@@ -45,27 +45,27 @@ discard block |
||
45 | 45 | } |
46 | 46 | EOD; |
47 | 47 | |
48 | - file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
48 | + file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
49 | 49 | |
50 | - chdir($this->testsWorkingDir); |
|
50 | + chdir($this->testsWorkingDir); |
|
51 | 51 | |
52 | - exec('composer install'); |
|
52 | + exec('composer install'); |
|
53 | 53 | |
54 | - $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
55 | - $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
54 | + $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
55 | + $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
56 | 56 | |
57 | - $mozartCompose = new Compose(); |
|
57 | + $mozartCompose = new Compose(); |
|
58 | 58 | |
59 | - $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
59 | + $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
60 | 60 | |
61 | - assert(0 === $result); |
|
61 | + assert(0 === $result); |
|
62 | 62 | |
63 | - $mpdf_php = file_get_contents($this->testsWorkingDir .'strauss/setasign/fpdi/src/FpdfTpl.php'); |
|
63 | + $mpdf_php = file_get_contents($this->testsWorkingDir .'strauss/setasign/fpdi/src/FpdfTpl.php'); |
|
64 | 64 | |
65 | - // Confirm problem is gone. |
|
66 | - $this->assertStringNotContainsString('class FpdfTpl extends \FPDF', $mpdf_php); |
|
65 | + // Confirm problem is gone. |
|
66 | + $this->assertStringNotContainsString('class FpdfTpl extends \FPDF', $mpdf_php); |
|
67 | 67 | |
68 | - // Confirm solution is correct. |
|
69 | - $this->assertStringContainsString('class FpdfTpl extends \Strauss_FPDF', $mpdf_php); |
|
70 | - } |
|
68 | + // Confirm solution is correct. |
|
69 | + $this->assertStringContainsString('class FpdfTpl extends \Strauss_FPDF', $mpdf_php); |
|
70 | + } |
|
71 | 71 | } |
@@ -20,21 +20,21 @@ discard block |
||
20 | 20 | class MozartIssue124Test extends IntegrationTestCase |
21 | 21 | { |
22 | 22 | |
23 | - /** |
|
24 | - * After PR #84, running Mozart on Mpdf began prefixing the class name inside the namespaced file. |
|
25 | - * |
|
26 | - * The problem coming from the filename matching the namespace name? |
|
27 | - * |
|
28 | - * dev-master#5d8041fdefc94ff57edcbe83ab468a9988c4fc11 |
|
29 | - * |
|
30 | - * @see https://github.com/coenjacobs/mozart/pull/84/files |
|
31 | - * |
|
32 | - * Should be: "class Mpdf implements" because its namespace has already been prefixed. |
|
33 | - */ |
|
34 | - public function test_it_does_not_make_classname_replacement_inside_namespaced_file() |
|
35 | - { |
|
36 | - |
|
37 | - $composerJsonString = <<<'EOD' |
|
23 | + /** |
|
24 | + * After PR #84, running Mozart on Mpdf began prefixing the class name inside the namespaced file. |
|
25 | + * |
|
26 | + * The problem coming from the filename matching the namespace name? |
|
27 | + * |
|
28 | + * dev-master#5d8041fdefc94ff57edcbe83ab468a9988c4fc11 |
|
29 | + * |
|
30 | + * @see https://github.com/coenjacobs/mozart/pull/84/files |
|
31 | + * |
|
32 | + * Should be: "class Mpdf implements" because its namespace has already been prefixed. |
|
33 | + */ |
|
34 | + public function test_it_does_not_make_classname_replacement_inside_namespaced_file() |
|
35 | + { |
|
36 | + |
|
37 | + $composerJsonString = <<<'EOD' |
|
38 | 38 | { |
39 | 39 | "name": "brianhenryie/mozart-issue-124", |
40 | 40 | "require": { |
@@ -49,44 +49,44 @@ discard block |
||
49 | 49 | } |
50 | 50 | EOD; |
51 | 51 | |
52 | - file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
52 | + file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
53 | 53 | |
54 | - chdir($this->testsWorkingDir); |
|
54 | + chdir($this->testsWorkingDir); |
|
55 | 55 | |
56 | - exec('composer install'); |
|
56 | + exec('composer install'); |
|
57 | 57 | |
58 | - $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
59 | - $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
58 | + $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
59 | + $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
60 | 60 | |
61 | - $mozartCompose = new Compose(); |
|
61 | + $mozartCompose = new Compose(); |
|
62 | 62 | |
63 | - $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
63 | + $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
64 | 64 | |
65 | - $mpdf_php = file_get_contents($this->testsWorkingDir .'strauss/mpdf/mpdf/src/Mpdf.php'); |
|
65 | + $mpdf_php = file_get_contents($this->testsWorkingDir .'strauss/mpdf/mpdf/src/Mpdf.php'); |
|
66 | 66 | |
67 | - // Confirm problem is gone. |
|
68 | - $this->assertStringNotContainsString('class BrianHenryIE\Strauss\Mpdf implements', $mpdf_php); |
|
67 | + // Confirm problem is gone. |
|
68 | + $this->assertStringNotContainsString('class BrianHenryIE\Strauss\Mpdf implements', $mpdf_php); |
|
69 | 69 | |
70 | - // Confirm solution is correct. |
|
71 | - $this->assertStringContainsString('class Mpdf implements', $mpdf_php); |
|
72 | - } |
|
70 | + // Confirm solution is correct. |
|
71 | + $this->assertStringContainsString('class Mpdf implements', $mpdf_php); |
|
72 | + } |
|
73 | 73 | |
74 | 74 | |
75 | - /** |
|
76 | - * Another Mpdf problem, presumably down to the classname matching the namespace. |
|
77 | - * |
|
78 | - * Typed function properties whose class type (name) match the namespace being replaced are |
|
79 | - * unintentionally prefixed, causing PHP to crash. |
|
80 | - * |
|
81 | - * Occurring at dev-master#3b1243ca8505fa6436569800dc34269178930f39 |
|
82 | - * |
|
83 | - * @see https://github.com/coenjacobs/mozart/issues/124 |
|
84 | - */ |
|
85 | - public function test_it_does_not_prefix_function_argument_types_whose_classname_matches_the_namespace() |
|
86 | - { |
|
75 | + /** |
|
76 | + * Another Mpdf problem, presumably down to the classname matching the namespace. |
|
77 | + * |
|
78 | + * Typed function properties whose class type (name) match the namespace being replaced are |
|
79 | + * unintentionally prefixed, causing PHP to crash. |
|
80 | + * |
|
81 | + * Occurring at dev-master#3b1243ca8505fa6436569800dc34269178930f39 |
|
82 | + * |
|
83 | + * @see https://github.com/coenjacobs/mozart/issues/124 |
|
84 | + */ |
|
85 | + public function test_it_does_not_prefix_function_argument_types_whose_classname_matches_the_namespace() |
|
86 | + { |
|
87 | 87 | |
88 | 88 | |
89 | - $composerJsonString = <<<'EOD' |
|
89 | + $composerJsonString = <<<'EOD' |
|
90 | 90 | { |
91 | 91 | "name": "brianhenryie/mozart-issue-124", |
92 | 92 | "require": { |
@@ -101,41 +101,41 @@ discard block |
||
101 | 101 | } |
102 | 102 | EOD; |
103 | 103 | |
104 | - file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
104 | + file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
105 | 105 | |
106 | - chdir($this->testsWorkingDir); |
|
106 | + chdir($this->testsWorkingDir); |
|
107 | 107 | |
108 | - exec('composer install'); |
|
108 | + exec('composer install'); |
|
109 | 109 | |
110 | - $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
111 | - $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
110 | + $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
111 | + $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
112 | 112 | |
113 | - $mozartCompose = new Compose(); |
|
113 | + $mozartCompose = new Compose(); |
|
114 | 114 | |
115 | - $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
115 | + $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
116 | 116 | |
117 | - $mpdf_php = file_get_contents($this->testsWorkingDir .'/strauss/mpdf/mpdf/src/Conversion/DecToOther.php'); |
|
117 | + $mpdf_php = file_get_contents($this->testsWorkingDir .'/strauss/mpdf/mpdf/src/Conversion/DecToOther.php'); |
|
118 | 118 | |
119 | - // Confirm problem is gone. |
|
120 | - $this->assertStringNotContainsString('public function __construct(BrianHenryIE\Strauss\Mpdf $mpdf)', $mpdf_php); |
|
119 | + // Confirm problem is gone. |
|
120 | + $this->assertStringNotContainsString('public function __construct(BrianHenryIE\Strauss\Mpdf $mpdf)', $mpdf_php); |
|
121 | 121 | |
122 | - // Confirm solution is correct. |
|
123 | - $this->assertStringContainsString('public function __construct(Mpdf $mpdf)', $mpdf_php); |
|
124 | - } |
|
125 | - // src/strauss/mpdf/mpdf/src/Barcode/BarcodeException.php |
|
122 | + // Confirm solution is correct. |
|
123 | + $this->assertStringContainsString('public function __construct(Mpdf $mpdf)', $mpdf_php); |
|
124 | + } |
|
125 | + // src/strauss/mpdf/mpdf/src/Barcode/BarcodeException.php |
|
126 | 126 | |
127 | 127 | |
128 | 128 | |
129 | - /** |
|
130 | - * Another Mpdf problem, presumably down to the classname matching the namespace. |
|
131 | - * |
|
132 | - * @see mpdf/mpdf/src/Barcode/BarcodeException.php |
|
133 | - */ |
|
134 | - public function testItDoesPrefixNamespacedExtends() |
|
135 | - { |
|
129 | + /** |
|
130 | + * Another Mpdf problem, presumably down to the classname matching the namespace. |
|
131 | + * |
|
132 | + * @see mpdf/mpdf/src/Barcode/BarcodeException.php |
|
133 | + */ |
|
134 | + public function testItDoesPrefixNamespacedExtends() |
|
135 | + { |
|
136 | 136 | |
137 | 137 | |
138 | - $composerJsonString = <<<'EOD' |
|
138 | + $composerJsonString = <<<'EOD' |
|
139 | 139 | { |
140 | 140 | "name": "brianhenryie/mozart-issue-124", |
141 | 141 | "require": { |
@@ -150,25 +150,25 @@ discard block |
||
150 | 150 | } |
151 | 151 | EOD; |
152 | 152 | |
153 | - file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
153 | + file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
154 | 154 | |
155 | - chdir($this->testsWorkingDir); |
|
155 | + chdir($this->testsWorkingDir); |
|
156 | 156 | |
157 | - exec('composer install'); |
|
157 | + exec('composer install'); |
|
158 | 158 | |
159 | - $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
160 | - $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
159 | + $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
160 | + $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
161 | 161 | |
162 | - $mozartCompose = new Compose(); |
|
162 | + $mozartCompose = new Compose(); |
|
163 | 163 | |
164 | - $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
164 | + $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
165 | 165 | |
166 | - $mpdf_php = file_get_contents($this->testsWorkingDir .'/strauss/mpdf/mpdf/src/Barcode/BarcodeException.php'); |
|
166 | + $mpdf_php = file_get_contents($this->testsWorkingDir .'/strauss/mpdf/mpdf/src/Barcode/BarcodeException.php'); |
|
167 | 167 | |
168 | - // Confirm problem is gone. |
|
169 | - $this->assertStringNotContainsString('class BarcodeException extends \Mpdf\MpdfException', $mpdf_php); |
|
168 | + // Confirm problem is gone. |
|
169 | + $this->assertStringNotContainsString('class BarcodeException extends \Mpdf\MpdfException', $mpdf_php); |
|
170 | 170 | |
171 | - // Confirm solution is correct. |
|
172 | - $this->assertStringContainsString('class BarcodeException extends \BrianHenryIE\Strauss\Mpdf\MpdfException', $mpdf_php); |
|
173 | - } |
|
171 | + // Confirm solution is correct. |
|
172 | + $this->assertStringContainsString('class BarcodeException extends \BrianHenryIE\Strauss\Mpdf\MpdfException', $mpdf_php); |
|
173 | + } |
|
174 | 174 | } |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | class MozartIssue109Test extends IntegrationTestCase |
23 | 23 | { |
24 | 24 | |
25 | - public function testTheOutputDoesNotPrefixComments() |
|
26 | - { |
|
25 | + public function testTheOutputDoesNotPrefixComments() |
|
26 | + { |
|
27 | 27 | |
28 | - $composerJsonString = <<<'EOD' |
|
28 | + $composerJsonString = <<<'EOD' |
|
29 | 29 | { |
30 | 30 | "minimum-stability": "dev", |
31 | 31 | "require": { |
@@ -52,21 +52,21 @@ discard block |
||
52 | 52 | } |
53 | 53 | EOD; |
54 | 54 | |
55 | - file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
55 | + file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
56 | 56 | |
57 | - chdir($this->testsWorkingDir); |
|
57 | + chdir($this->testsWorkingDir); |
|
58 | 58 | |
59 | - exec('composer install'); |
|
59 | + exec('composer install'); |
|
60 | 60 | |
61 | - $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
62 | - $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
61 | + $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
62 | + $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
63 | 63 | |
64 | - $mozartCompose = new Compose(); |
|
64 | + $mozartCompose = new Compose(); |
|
65 | 65 | |
66 | - $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
66 | + $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
67 | 67 | |
68 | - $phpString = file_get_contents($this->testsWorkingDir .'strauss/nesbot/carbon/src/Carbon/Carbon.php'); |
|
68 | + $phpString = file_get_contents($this->testsWorkingDir .'strauss/nesbot/carbon/src/Carbon/Carbon.php'); |
|
69 | 69 | |
70 | - $this->assertStringNotContainsString('*Mozart\\ This file is part of the Carbon package.Mozart\\', $phpString); |
|
71 | - } |
|
70 | + $this->assertStringNotContainsString('*Mozart\\ This file is part of the Carbon package.Mozart\\', $phpString); |
|
71 | + } |
|
72 | 72 | } |
@@ -18,50 +18,50 @@ discard block |
||
18 | 18 | class MozartIssue89Test extends IntegrationTestCase |
19 | 19 | { |
20 | 20 | |
21 | - /** |
|
22 | - * If a file is specified more than once in an autoloader, e.g. is explicitly listed and is also in a folder listed, |
|
23 | - * a "File already exists at path" error occurs. |
|
24 | - * |
|
25 | - * To fix this, we enumerate the files to be copied using a dictionary indexed with the source file path, then loop |
|
26 | - * and copy, thus only copying each one once. |
|
27 | - * |
|
28 | - * Original error: |
|
29 | - * "League\Flysystem\FileExistsException : File already exists at path: lib/classes/tecnickcom/tcpdf/tcpdf.php" |
|
30 | - * |
|
31 | - * Test is using a known problematic autoloader: |
|
32 | - * "iio/libmergepdf": { |
|
33 | - * "classmap": [ |
|
34 | - * "config", |
|
35 | - * "include", |
|
36 | - * "tcpdf.php", |
|
37 | - * "tcpdf_parser.php", |
|
38 | - * "tcpdf_import.php", |
|
39 | - * "tcpdf_barcodes_1d.php", |
|
40 | - * "tcpdf_barcodes_2d.php", |
|
41 | - * "include/tcpdf_colors.php", |
|
42 | - * "include/tcpdf_filters.php", |
|
43 | - * "include/tcpdf_font_data.php", |
|
44 | - * "include/tcpdf_fonts.php", |
|
45 | - * "include/tcpdf_images.php", |
|
46 | - * "include/tcpdf_static.php", |
|
47 | - * "include/barcodes/datamatrix.php", |
|
48 | - * "include/barcodes/pdf417.php", |
|
49 | - * "include/barcodes/qrcode.php" |
|
50 | - * ] |
|
51 | - * } |
|
52 | - * |
|
53 | - * @see https://github.com/coenjacobs/mozart/issues/89 |
|
54 | - * |
|
55 | - * @test |
|
56 | - */ |
|
57 | - public function it_moves_each_file_once_per_namespace() |
|
58 | - { |
|
59 | - |
|
60 | - if (version_compare(phpversion(), '8.0.0', '>=')) { |
|
61 | - $this->markTestSkipped("Package specified for test is not PHP 8 compatible"); |
|
62 | - } |
|
63 | - |
|
64 | - $composerJsonString = <<<'EOD' |
|
21 | + /** |
|
22 | + * If a file is specified more than once in an autoloader, e.g. is explicitly listed and is also in a folder listed, |
|
23 | + * a "File already exists at path" error occurs. |
|
24 | + * |
|
25 | + * To fix this, we enumerate the files to be copied using a dictionary indexed with the source file path, then loop |
|
26 | + * and copy, thus only copying each one once. |
|
27 | + * |
|
28 | + * Original error: |
|
29 | + * "League\Flysystem\FileExistsException : File already exists at path: lib/classes/tecnickcom/tcpdf/tcpdf.php" |
|
30 | + * |
|
31 | + * Test is using a known problematic autoloader: |
|
32 | + * "iio/libmergepdf": { |
|
33 | + * "classmap": [ |
|
34 | + * "config", |
|
35 | + * "include", |
|
36 | + * "tcpdf.php", |
|
37 | + * "tcpdf_parser.php", |
|
38 | + * "tcpdf_import.php", |
|
39 | + * "tcpdf_barcodes_1d.php", |
|
40 | + * "tcpdf_barcodes_2d.php", |
|
41 | + * "include/tcpdf_colors.php", |
|
42 | + * "include/tcpdf_filters.php", |
|
43 | + * "include/tcpdf_font_data.php", |
|
44 | + * "include/tcpdf_fonts.php", |
|
45 | + * "include/tcpdf_images.php", |
|
46 | + * "include/tcpdf_static.php", |
|
47 | + * "include/barcodes/datamatrix.php", |
|
48 | + * "include/barcodes/pdf417.php", |
|
49 | + * "include/barcodes/qrcode.php" |
|
50 | + * ] |
|
51 | + * } |
|
52 | + * |
|
53 | + * @see https://github.com/coenjacobs/mozart/issues/89 |
|
54 | + * |
|
55 | + * @test |
|
56 | + */ |
|
57 | + public function it_moves_each_file_once_per_namespace() |
|
58 | + { |
|
59 | + |
|
60 | + if (version_compare(phpversion(), '8.0.0', '>=')) { |
|
61 | + $this->markTestSkipped("Package specified for test is not PHP 8 compatible"); |
|
62 | + } |
|
63 | + |
|
64 | + $composerJsonString = <<<'EOD' |
|
65 | 65 | { |
66 | 66 | "name": "brianhenryie/mozart-issue-89", |
67 | 67 | "require": { |
@@ -76,30 +76,30 @@ discard block |
||
76 | 76 | } |
77 | 77 | EOD; |
78 | 78 | |
79 | - file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
79 | + file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
80 | 80 | |
81 | - chdir($this->testsWorkingDir); |
|
81 | + chdir($this->testsWorkingDir); |
|
82 | 82 | |
83 | - exec('composer install'); |
|
83 | + exec('composer install'); |
|
84 | 84 | |
85 | - $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
86 | - $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
85 | + $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
86 | + $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
87 | 87 | |
88 | - $mozartCompose = new Compose(); |
|
88 | + $mozartCompose = new Compose(); |
|
89 | 89 | |
90 | - // $this->expectException(League\Flysystem\FileExistsException::class); |
|
90 | + // $this->expectException(League\Flysystem\FileExistsException::class); |
|
91 | 91 | |
92 | - $exception = null; |
|
92 | + $exception = null; |
|
93 | 93 | |
94 | - try { |
|
95 | - $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
96 | - } catch (\League\Flysystem\FileExistsException $e) { |
|
97 | - $exception = $e; |
|
98 | - } |
|
94 | + try { |
|
95 | + $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
96 | + } catch (\League\Flysystem\FileExistsException $e) { |
|
97 | + $exception = $e; |
|
98 | + } |
|
99 | 99 | |
100 | - // On the failing test, an exception was thrown and this line was not reached. |
|
101 | - $this->assertEquals(0, $result); |
|
100 | + // On the failing test, an exception was thrown and this line was not reached. |
|
101 | + $this->assertEquals(0, $result); |
|
102 | 102 | |
103 | - $this->assertNull($exception); |
|
104 | - } |
|
103 | + $this->assertNull($exception); |
|
104 | + } |
|
105 | 105 | } |
@@ -21,17 +21,17 @@ discard block |
||
21 | 21 | class MozartIssue13Test extends IntegrationTestCase |
22 | 22 | { |
23 | 23 | |
24 | - /** |
|
25 | - * |
|
26 | - * "paypal/rest-api-sdk-php" |
|
27 | - * |
|
28 | - */ |
|
29 | - public function testPaypalStringReplacement() |
|
30 | - { |
|
24 | + /** |
|
25 | + * |
|
26 | + * "paypal/rest-api-sdk-php" |
|
27 | + * |
|
28 | + */ |
|
29 | + public function testPaypalStringReplacement() |
|
30 | + { |
|
31 | 31 | |
32 | 32 | // $this->markTestSkipped('This test was passing until I excluded the PSR namespace'); |
33 | 33 | |
34 | - $composerJsonString = <<<'EOD' |
|
34 | + $composerJsonString = <<<'EOD' |
|
35 | 35 | { |
36 | 36 | "name": "brianhenryie/mozart-issue-13", |
37 | 37 | "require": { |
@@ -50,22 +50,22 @@ discard block |
||
50 | 50 | } |
51 | 51 | EOD; |
52 | 52 | |
53 | - file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
53 | + file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
54 | 54 | |
55 | - chdir($this->testsWorkingDir); |
|
55 | + chdir($this->testsWorkingDir); |
|
56 | 56 | |
57 | - exec('composer install'); |
|
57 | + exec('composer install'); |
|
58 | 58 | |
59 | - $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
60 | - $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
59 | + $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
60 | + $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
61 | 61 | |
62 | - $mozartCompose = new Compose(); |
|
62 | + $mozartCompose = new Compose(); |
|
63 | 63 | |
64 | - $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
64 | + $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
65 | 65 | |
66 | - $phpString = file_get_contents($this->testsWorkingDir .'/strauss/paypal/rest-api-sdk-php/lib/PayPal/Log/PayPalLogger.php'); |
|
66 | + $phpString = file_get_contents($this->testsWorkingDir .'/strauss/paypal/rest-api-sdk-php/lib/PayPal/Log/PayPalLogger.php'); |
|
67 | 67 | |
68 | - // Confirm solution is correct. |
|
69 | - $this->assertStringContainsString('constant("\\\\BrianHenryIE\\\\Strauss\\\\Psr\\\\Log\\\\LogLevel::$loggingLevel")', $phpString); |
|
70 | - } |
|
68 | + // Confirm solution is correct. |
|
69 | + $this->assertStringContainsString('constant("\\\\BrianHenryIE\\\\Strauss\\\\Psr\\\\Log\\\\LogLevel::$loggingLevel")', $phpString); |
|
70 | + } |
|
71 | 71 | } |
@@ -17,15 +17,15 @@ discard block |
||
17 | 17 | class StraussIssue14Test extends \BrianHenryIE\Strauss\Tests\Integration\Util\IntegrationTestCase |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * Looks like the exclude_from_prefix regex for psr is not specific enough. |
|
22 | - * |
|
23 | - * @author BrianHenryIE |
|
24 | - */ |
|
25 | - public function test_guzzle_http_is_prefixed() |
|
26 | - { |
|
27 | - |
|
28 | - $composerJsonString = <<<'EOD' |
|
20 | + /** |
|
21 | + * Looks like the exclude_from_prefix regex for psr is not specific enough. |
|
22 | + * |
|
23 | + * @author BrianHenryIE |
|
24 | + */ |
|
25 | + public function test_guzzle_http_is_prefixed() |
|
26 | + { |
|
27 | + |
|
28 | + $composerJsonString = <<<'EOD' |
|
29 | 29 | { |
30 | 30 | "name": "brianhenryie/strauss-issue-14", |
31 | 31 | "require":{ |
@@ -42,31 +42,31 @@ discard block |
||
42 | 42 | } |
43 | 43 | EOD; |
44 | 44 | |
45 | - file_put_contents($this->testsWorkingDir . 'composer.json', $composerJsonString); |
|
45 | + file_put_contents($this->testsWorkingDir . 'composer.json', $composerJsonString); |
|
46 | 46 | |
47 | - chdir($this->testsWorkingDir); |
|
47 | + chdir($this->testsWorkingDir); |
|
48 | 48 | |
49 | - exec('composer install'); |
|
49 | + exec('composer install'); |
|
50 | 50 | |
51 | - $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
52 | - $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
51 | + $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
52 | + $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
53 | 53 | |
54 | - $mozartCompose = new Compose(); |
|
54 | + $mozartCompose = new Compose(); |
|
55 | 55 | |
56 | - $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
56 | + $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
57 | 57 | |
58 | - $php_string = file_get_contents($this->testsWorkingDir . '/strauss/guzzlehttp/psr7/src/AppendStream.php'); |
|
58 | + $php_string = file_get_contents($this->testsWorkingDir . '/strauss/guzzlehttp/psr7/src/AppendStream.php'); |
|
59 | 59 | |
60 | - // was namespace GuzzleHttp\Psr7; |
|
60 | + // was namespace GuzzleHttp\Psr7; |
|
61 | 61 | |
62 | - // Confirm solution is correct. |
|
63 | - $this->assertStringContainsString('namespace BrianHenryIE\Strauss\GuzzleHttp\Psr7;', $php_string); |
|
64 | - } |
|
62 | + // Confirm solution is correct. |
|
63 | + $this->assertStringContainsString('namespace BrianHenryIE\Strauss\GuzzleHttp\Psr7;', $php_string); |
|
64 | + } |
|
65 | 65 | |
66 | - public function testFilesAutoloaderIsGenerated() |
|
67 | - { |
|
66 | + public function testFilesAutoloaderIsGenerated() |
|
67 | + { |
|
68 | 68 | |
69 | - $composerJsonString = <<<'EOD' |
|
69 | + $composerJsonString = <<<'EOD' |
|
70 | 70 | { |
71 | 71 | "name": "brianhenryie/strauss-issue-14", |
72 | 72 | "require":{ |
@@ -83,19 +83,19 @@ discard block |
||
83 | 83 | } |
84 | 84 | EOD; |
85 | 85 | |
86 | - file_put_contents($this->testsWorkingDir . 'composer.json', $composerJsonString); |
|
86 | + file_put_contents($this->testsWorkingDir . 'composer.json', $composerJsonString); |
|
87 | 87 | |
88 | - chdir($this->testsWorkingDir); |
|
88 | + chdir($this->testsWorkingDir); |
|
89 | 89 | |
90 | - exec('composer install'); |
|
90 | + exec('composer install'); |
|
91 | 91 | |
92 | - $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
93 | - $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
92 | + $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
93 | + $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
94 | 94 | |
95 | - $mozartCompose = new Compose(); |
|
95 | + $mozartCompose = new Compose(); |
|
96 | 96 | |
97 | - $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
97 | + $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
98 | 98 | |
99 | - $this->assertFileExists($this->testsWorkingDir . '/strauss/autoload-files.php'); |
|
100 | - } |
|
99 | + $this->assertFileExists($this->testsWorkingDir . '/strauss/autoload-files.php'); |
|
100 | + } |
|
101 | 101 | } |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | class MozartIssue99Test extends IntegrationTestCase |
26 | 26 | { |
27 | 27 | |
28 | - /** |
|
29 | - * WooCommerce Action Scheduler ... has no autoload key. But also needs some Mozart patches to work correctly. |
|
30 | - */ |
|
31 | - public function test_it_does_not_make_classname_replacement_inside_namespaced_file() |
|
32 | - { |
|
28 | + /** |
|
29 | + * WooCommerce Action Scheduler ... has no autoload key. But also needs some Mozart patches to work correctly. |
|
30 | + */ |
|
31 | + public function test_it_does_not_make_classname_replacement_inside_namespaced_file() |
|
32 | + { |
|
33 | 33 | |
34 | - $composerJsonString = <<<'EOD' |
|
34 | + $composerJsonString = <<<'EOD' |
|
35 | 35 | { |
36 | 36 | "require": { |
37 | 37 | "mustache/mustache": "2.13.0" |
@@ -46,19 +46,19 @@ discard block |
||
46 | 46 | } |
47 | 47 | EOD; |
48 | 48 | |
49 | - file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
49 | + file_put_contents($this->testsWorkingDir . '/composer.json', $composerJsonString); |
|
50 | 50 | |
51 | - chdir($this->testsWorkingDir); |
|
51 | + chdir($this->testsWorkingDir); |
|
52 | 52 | |
53 | - exec('composer install'); |
|
53 | + exec('composer install'); |
|
54 | 54 | |
55 | - $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
56 | - $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
55 | + $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
56 | + $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
57 | 57 | |
58 | - $mozartCompose = new Compose(); |
|
58 | + $mozartCompose = new Compose(); |
|
59 | 59 | |
60 | - $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
60 | + $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
61 | 61 | |
62 | - $this->markTestIncomplete("What to assert!?"); |
|
63 | - } |
|
62 | + $this->markTestIncomplete("What to assert!?"); |
|
63 | + } |
|
64 | 64 | } |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | class StraussIssue11Test extends \BrianHenryIE\Strauss\Tests\Integration\Util\IntegrationTestCase |
24 | 24 | { |
25 | 25 | |
26 | - /** |
|
27 | - * @author BrianHenryIE |
|
28 | - */ |
|
29 | - public function test_migrate_mozart_config() |
|
30 | - { |
|
26 | + /** |
|
27 | + * @author BrianHenryIE |
|
28 | + */ |
|
29 | + public function test_migrate_mozart_config() |
|
30 | + { |
|
31 | 31 | |
32 | - $composerExtraStraussJson = <<<'EOD' |
|
32 | + $composerExtraStraussJson = <<<'EOD' |
|
33 | 33 | { |
34 | 34 | "name": "brianhenryie/strauss-issue-8", |
35 | 35 | "extra": { |
@@ -61,27 +61,27 @@ discard block |
||
61 | 61 | } |
62 | 62 | EOD; |
63 | 63 | |
64 | - $tmpfname = tempnam(sys_get_temp_dir(), 'strauss-test-'); |
|
65 | - file_put_contents($tmpfname, $composerExtraStraussJson); |
|
64 | + $tmpfname = tempnam(sys_get_temp_dir(), 'strauss-test-'); |
|
65 | + file_put_contents($tmpfname, $composerExtraStraussJson); |
|
66 | 66 | |
67 | - $composer = Factory::create(new NullIO(), $tmpfname); |
|
67 | + $composer = Factory::create(new NullIO(), $tmpfname); |
|
68 | 68 | |
69 | - $straussConfig = new StraussConfig($composer); |
|
69 | + $straussConfig = new StraussConfig($composer); |
|
70 | 70 | |
71 | - $this->assertEquals('src/Mozart/', $straussConfig->getTargetDirectory()); |
|
71 | + $this->assertEquals('src/Mozart/', $straussConfig->getTargetDirectory()); |
|
72 | 72 | |
73 | - $this->assertEquals("MZoo\\MBO_Sandbox\\Dependencies", $straussConfig->getNamespacePrefix()); |
|
74 | - } |
|
73 | + $this->assertEquals("MZoo\\MBO_Sandbox\\Dependencies", $straussConfig->getNamespacePrefix()); |
|
74 | + } |
|
75 | 75 | |
76 | 76 | |
77 | 77 | |
78 | - /** |
|
79 | - * @author BrianHenryIE |
|
80 | - */ |
|
81 | - public function test_carbon_fields() |
|
82 | - { |
|
78 | + /** |
|
79 | + * @author BrianHenryIE |
|
80 | + */ |
|
81 | + public function test_carbon_fields() |
|
82 | + { |
|
83 | 83 | |
84 | - $composerJsonString = <<<'EOD' |
|
84 | + $composerJsonString = <<<'EOD' |
|
85 | 85 | { |
86 | 86 | "name": "brianhenryie/strauss-issue-8", |
87 | 87 | "require":{ |
@@ -114,35 +114,35 @@ discard block |
||
114 | 114 | } |
115 | 115 | EOD; |
116 | 116 | |
117 | - file_put_contents($this->testsWorkingDir . 'composer.json', $composerJsonString); |
|
117 | + file_put_contents($this->testsWorkingDir . 'composer.json', $composerJsonString); |
|
118 | 118 | |
119 | - chdir($this->testsWorkingDir); |
|
119 | + chdir($this->testsWorkingDir); |
|
120 | 120 | |
121 | - exec('composer install'); |
|
121 | + exec('composer install'); |
|
122 | 122 | |
123 | - $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
124 | - $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
123 | + $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
124 | + $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
125 | 125 | |
126 | - $mozartCompose = new Compose(); |
|
126 | + $mozartCompose = new Compose(); |
|
127 | 127 | |
128 | - $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
128 | + $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
129 | 129 | |
130 | - $phpString = file_get_contents($this->testsWorkingDir .'src/Mozart/htmlburger/carbon-fields/core/Carbon_Fields.php'); |
|
130 | + $phpString = file_get_contents($this->testsWorkingDir .'src/Mozart/htmlburger/carbon-fields/core/Carbon_Fields.php'); |
|
131 | 131 | |
132 | - // This was not being prefixed. |
|
133 | - $this->assertStringNotContainsString('$ioc->register( new \Carbon_Fields\Provider\Container_Condition_Provider() );', $phpString); |
|
132 | + // This was not being prefixed. |
|
133 | + $this->assertStringNotContainsString('$ioc->register( new \Carbon_Fields\Provider\Container_Condition_Provider() );', $phpString); |
|
134 | 134 | |
135 | - $this->assertStringContainsString('$ioc->register( new \MZoo\MBO_Sandbox\Dependencies\Carbon_Fields\Provider\Container_Condition_Provider() );', $phpString); |
|
136 | - } |
|
135 | + $this->assertStringContainsString('$ioc->register( new \MZoo\MBO_Sandbox\Dependencies\Carbon_Fields\Provider\Container_Condition_Provider() );', $phpString); |
|
136 | + } |
|
137 | 137 | |
138 | 138 | |
139 | - /** |
|
140 | - * @author BrianHenryIE |
|
141 | - */ |
|
142 | - public function test_static_namespace() |
|
143 | - { |
|
139 | + /** |
|
140 | + * @author BrianHenryIE |
|
141 | + */ |
|
142 | + public function test_static_namespace() |
|
143 | + { |
|
144 | 144 | |
145 | - $composerJsonString = <<<'EOD' |
|
145 | + $composerJsonString = <<<'EOD' |
|
146 | 146 | { |
147 | 147 | "name": "brianhenryie/strauss-issue-8", |
148 | 148 | "require":{ |
@@ -175,24 +175,24 @@ discard block |
||
175 | 175 | } |
176 | 176 | EOD; |
177 | 177 | |
178 | - file_put_contents($this->testsWorkingDir . 'composer.json', $composerJsonString); |
|
178 | + file_put_contents($this->testsWorkingDir . 'composer.json', $composerJsonString); |
|
179 | 179 | |
180 | - chdir($this->testsWorkingDir); |
|
180 | + chdir($this->testsWorkingDir); |
|
181 | 181 | |
182 | - exec('composer install'); |
|
182 | + exec('composer install'); |
|
183 | 183 | |
184 | - $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
185 | - $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
184 | + $inputInterfaceMock = $this->createMock(InputInterface::class); |
|
185 | + $outputInterfaceMock = $this->createMock(OutputInterface::class); |
|
186 | 186 | |
187 | - $mozartCompose = new Compose(); |
|
187 | + $mozartCompose = new Compose(); |
|
188 | 188 | |
189 | - $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
189 | + $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); |
|
190 | 190 | |
191 | - $phpString = file_get_contents($this->testsWorkingDir .'src/Mozart/htmlburger/carbon-fields/core/Container.php'); |
|
191 | + $phpString = file_get_contents($this->testsWorkingDir .'src/Mozart/htmlburger/carbon-fields/core/Container.php'); |
|
192 | 192 | |
193 | - // This was not being prefixed. |
|
194 | - $this->assertStringNotContainsString('@method static \Carbon_Fields\Container\Comment_Meta_Container', $phpString); |
|
193 | + // This was not being prefixed. |
|
194 | + $this->assertStringNotContainsString('@method static \Carbon_Fields\Container\Comment_Meta_Container', $phpString); |
|
195 | 195 | |
196 | - $this->assertStringContainsString('@method static \MZoo\MBO_Sandbox\Dependencies\Carbon_Fields\Container\Comment_Meta_Container', $phpString); |
|
197 | - } |
|
196 | + $this->assertStringContainsString('@method static \MZoo\MBO_Sandbox\Dependencies\Carbon_Fields\Container\Comment_Meta_Container', $phpString); |
|
197 | + } |
|
198 | 198 | } |