8000 Test improvements, use Nowdoc instead of Heredoc. · symfony/flex@e362503 · GitHub
[go: up one dir, main page]

Skip to content

Commit e362503

Browse files
committed
Test improvements, use Nowdoc instead of Heredoc.
1 parent b13714e commit e362503

File tree

7 files changed

+27
-27
lines changed

7 files changed

+27
-27
lines changed

tests/Command/DumpEnvCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testFileIsCreated()
2828
@unlink($env);
2929
@unlink($envLocal);
3030

31-
$envContent = <<<EOF
31+
$envContent = <<<'EOF'
3232
APP_ENV=dev
3333
APP_SECRET=abcdefgh123456789
3434
EOF;
@@ -59,7 +59,7 @@ public function testEmptyOptionMustIgnoreContent()
5959
@unlink($env);
6060
@unlink($envLocal);
6161

62-
$envContent = <<<EOF
62+
$envContent = <<<'EOF'
6363
APP_ENV=dev
6464
APP_SECRET=abcdefgh123456789
6565
EOF;

tests/Configurator/BundlesConfiguratorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function testConfigure()
3737
'FooBundle' => ['dev', 'test'],
3838
'Symfony\Bundle\FrameworkBundle\FrameworkBundle' => ['all'],
3939
], $lock);
40-
$this->assertEquals(<<<EOF
40+
$this->assertEquals(<<<'EOF'
4141
<?php
4242
4343
return [
@@ -52,7 +52,7 @@ public function testConfigure()
5252
public function testConfigureWhenBundlesAlreayExists()
5353
{
5454
$config = FLEX_TEST_DIR.'/config/bundles.php';
55-
file_put_contents($config, <<<EOF
55+
file_put_contents($config, <<<'EOF'
5656
<?php
5757
5858
return [
@@ -74,7 +74,7 @@ public function testConfigureWhenBundlesAlreayExists()
7474
'FooBundle' => ['dev', 'test'],
7575
'Symfony\Bundle\FrameworkBundle\FrameworkBundle' => ['all'],
7676
], $lock);
77-
$this->assertEquals(<<<EOF
77+
$this->assertEquals(<<<'EOF'
7878
<?php
7979
8080
return [

tests/Configurator/ContainerConfiguratorTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testConfigure()
4242
new Options(['config-dir' => 'config', 'root-dir' => FLEX_TEST_DIR])
4343
);
4444
$configurator->configure($recipe, ['locale' => 'en'], $lock);
45-
$this->assertEquals(<<<EOF
45+
$this->assertEquals(<<<'EOF'
4646
# comment
4747
parameters:
4848
locale: 'en'
@@ -53,7 +53,7 @@ public function testConfigure()
5353
, file_get_contents($config));
5454

5555
$configurator->unconfigure($recipe, ['locale' => 'en'], $lock);
56-
$this->assertEquals(<<<EOF
56+
$this->assertEquals(<<<'EOF'
5757
# comment
5858
parameters:
5959
@@ -81,7 +81,7 @@ public function testConfigureWithoutParametersKey()
8181
new Options(['config-dir' => 'config', 'root-dir' => FLEX_TEST_DIR])
8282
);
8383
$configurator->configure($recipe, ['locale' => 'en'], $lock);
84-
$this->assertEquals(<<<EOF
84+
$this->assertEquals(<<<'EOF'
8585
parameters:
8686
locale: 'en'
8787
@@ -91,7 +91,7 @@ public function testConfigureWithoutParametersKey()
9191
, file_get_contents($config));
9292

9393
$configurator->unconfigure($recipe, ['locale' => 'en'], $lock);
94-
$this->assertEquals(<<<EOF
94+
$this->assertEquals(<<<'EOF'
9595
parameters:
9696
9797
services:
@@ -121,7 +121,7 @@ public function testConfigureWithoutDuplicated()
121121
new Options(['config-dir' => 'config', 'root-dir' => FLEX_TEST_DIR])
122122
);
123123
$configurator->configure($recipe, ['locale' => 'en'], $lock);
124-
$this->assertEquals(<<<EOF
124+
$this->assertEquals(<<<'EOF'
125125
parameters:
126126
locale: es
127127
@@ -131,7 +131,7 @@ public function testConfigureWithoutDuplicated()
131131
, file_get_contents($config));
132132

133133
$configurator->unconfigure($recipe, ['locale' => 'en'], $lock);
134-
$this->assertEquals(<<<EOF
134+
$this->assertEquals(<<<'EOF'
135135
parameters:
136136
137137
services:
@@ -165,7 +165,7 @@ public function testConfigureWithComplexContent()
165165
new Options(['config-dir' => 'config', 'root-dir' => FLEX_TEST_DIR])
166166
);
167167
$configurator->configure($recipe, ['locale' => 'en', 'foobar' => 'baz'], $lock);
168-
$this->assertEquals(<<<EOF
168+
$this->assertEquals(<<<'EOF'
169169
parameters:
170170
# comment 1
171171
locale: es
@@ -180,7 +180,7 @@ public function testConfigureWithComplexContent()
180180
, file_get_contents($config));
181181

182182
$configurator->unconfigure($recipe, ['locale' => 'en', 'foobar' => 'baz'], $lock);
183-
$this->assertEquals(<<<EOF
183+
$this->assertEquals(<<<'EOF'
184184
parameters:
185185
# comment 1
186186
@@ -215,7 +215,7 @@ public function testConfigureWithComplexContent2()
215215
new Options(['config-dir' => 'config', 'root-dir' => FLEX_TEST_DIR])
216216
);
217217
$configurator->configure($recipe, ['locale' => 'en', 'foobar' => 'baz', 'array' => ['key1' => 'value', 'key2' => "Escape ' one quote"], 'key1' => 'Keep It'], $lock);
218-
$this->assertEquals(<<<EOF
218+
$this->assertEquals(<<<'EOF'
219219
parameters:
220220
# comment 1
221221
locale: es
@@ -231,7 +231,7 @@ public function testConfigureWithComplexContent2()
231231
, file_get_contents($config));
232232

233233
$configurator->unconfigure($recipe, ['locale' => 'en', 'array' => ['key1' => 'value', 'key2' => "Escape ' one quote"]], $lock);
234-
$this->assertEquals(<<<EOF
234+
$this->assertEquals(<<<'EOF'
235235
parameters:
236236
# comment 1
237237
foobar: 'baz'
@@ -265,7 +265,7 @@ public function testConfigureWithEnvVariable()
265265
new Options(['config-dir' => 'config', 'root-dir' => FLEX_TEST_DIR])
266266
);
267267
$configurator->configure($recipe, ['env(APP_ENV)' => ''], $lock);
268-
$this->assertEquals(<<<EOF
268+
$this->assertEquals(<<<'EOF'
269269
# comment
270270
parameters:
271271
env(APP_ENV): ''
@@ -276,7 +276,7 @@ public function testConfigureWithEnvVariable()
276276
, file_get_contents($config));
277277

278278
$configurator->unconfigure($recipe, ['env(APP_ENV)' => ''], $lock);
279-
$this->assertEquals(<<<EOF
279+
$this->assertEquals(<<<'EOF'
280280
# comment
281281
parameters:
282282

tests/Configurator/EnvConfiguratorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function testConfigure()
5656
'APP_SECRET' => 's3cretf0rt3st"<>',
5757
], $lock);
5858

59-
$envContents = <<<EOF
59+
$envContents = <<<'EOF'
6060
6161
###> FooBundle ###
6262
APP_ENV="test bar"
@@ -72,7 +72,7 @@ public function testConfigure()
7272
###< FooBundle ###
7373

7474
EOF;
75-
$xmlContents = <<<EOF
75+
$xmlContent F438 s = <<<'EOF'
7676
<?xml version="1.0" encoding="UTF-8"?>
7777
7878
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
@@ -137,7 +137,7 @@ public function testConfigure()
137137

138138
$this->assertStringEqualsFile(
139139
$env,
140-
<<<EOF
140+
<<<'EOF'
141141

142142

143143
EOF

tests/Configurator/GitignoreConfiguratorTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ public function testConfigure()
4949
'/vendor/',
5050
];
5151

52-
$gitignoreContents1 = <<<EOF
52+
$gitignoreContents1 = <<<'EOF'
5353
###> FooBundle ###
5454
.env
5555
/public/bundles/
5656
###< FooBundle ###
5757
EOF;
58-
$gitignoreContents2 = <<<EOF
58+
$gitignoreContents2 = <<<'EOF'
5959
###> BarBundle ###
6060
/var/
6161
/vendor/
@@ -97,7 +97,7 @@ public function testConfigureForce()
9797
touch($gitignore);
9898
file_put_contents($gitignore, "# preexisting content\n");
9999

100-
$contentsConfigure = <<<EOF
100+
$contentsConfigure = <<<'EOF'
101101
# preexisting content
102102
103103
###> FooBundle ###
@@ -106,7 +106,7 @@ public function testConfigureForce()
106106
107107
# new content
108108
EOF;
109-
$contentsForce = <<<EOF
109+
$contentsForce = <<<'EOF'
110110
# preexisting content
111111
112112
###> FooBundle ###

tests/Configurator/MakefileConfiguratorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testConfigure()
4242

4343
$makefile1 = explode(
4444
"\n",
45-
<<<EOF
45+
<<<'EOF'
4646
CONSOLE := $(shell which bin/console)
4747
sf_console:
4848
ifndef CONSOLE
@@ -52,7 +52,7 @@ public function testConfigure()
5252
);
5353
$makefile2 = explode(
5454
"\n",
55-
<<<EOF
55+
<<<'EOF'
5656
cache-clear:
5757
ifdef CONSOLE
5858
@$(CONSOLE) cache:clear --no-warmup

tests/FlexTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function testPostInstall()
111111
$this->assertSame($expected, $postInstallOutput);
112112

113113
$this->assertSame(
114-
<<<EOF
114+
<<<'EOF'
115115
Symfony operations: 1 recipe ()
116116
- Configuring dummy/dummy (>=1.0): From github.com/symfony/recipes:master
117117

0 commit comments

Comments
 (0)
0