8000 Test improvements, use Nowdoc instead of Heredoc if possible by fre5h · Pull Request #600 · symfony/flex · GitHub
[go: up one dir, main page]

Skip to content

Test improvements, use Nowdoc instead of Heredoc if possible #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/Command/DumpEnvCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testFileIsCreated()
@unlink($env);
@unlink($envLocal);

$envContent = <<<EOF
$envContent = <<<'EOF'
APP_ENV=dev
APP_SECRET=abcdefgh123456789
EOF;
Expand Down Expand Up @@ -59,7 +59,7 @@ public function testEmptyOptionMustIgnoreContent()
@unlink($env);
@unlink($envLocal);

$envContent = <<<EOF
$envContent = <<<'EOF'
APP_ENV=dev
APP_SECRET=abcdefgh123456789
EOF;
Expand Down
6 changes: 3 additions & 3 deletions tests/Configurator/BundlesConfiguratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testConfigure()
'FooBundle' => ['dev', 'test'],
'Symfony\Bundle\FrameworkBundle\FrameworkBundle' => ['all'],
], $lock);
$this->assertEquals(<<<EOF
$this->assertEquals(<<<'EOF'
<?php

return [
Expand All @@ -52,7 +52,7 @@ public function testConfigure()
public function testConfigureWhenBundlesAlreayExists()
{
$config = FLEX_TEST_DIR.'/config/bundles.php';
file_put_contents($config, <<<EOF
file_put_contents($config, <<<'EOF'
<?php

return [
Expand All @@ -74,7 +74,7 @@ public function testConfigureWhenBundlesAlreayExists()
'FooBundle' => ['dev', 'test'],
'Symfony\Bundle\FrameworkBundle\FrameworkBundle' => ['all'],
], $lock);
$this->assertEquals(<<<EOF
$this->assertEquals(<<<'EOF'
<?php

return [
Expand Down
24 changes: 12 additions & 12 deletions tests/Configurator/ContainerConfiguratorTest.php
< 8000 td class="blob-code blob-code-addition js-file-line"> $this->assertEquals(<<<'EOF'
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function testConfigure()
new Options(['config-dir' => 'config', 'root-dir' => FLEX_TEST_DIR])
);
$configurator->configure($recipe, ['locale' => 'en'], $lock);
$this->assertEquals(<<<EOF
$this->assertEquals(<<<'EOF'
# comment
parameters:
locale: 'en'
Expand All @@ -53,7 +53,7 @@ public function testConfigure()
, file_get_contents($config));

$configurator->unconfigure($recipe, ['locale' => 'en'], $lock);
$this->assertEquals(<<<EOF
$this->assertEquals(<<<'EOF'
# comment
parameters:

Expand Down Expand Up @@ -81,7 +81,7 @@ public function testConfigureWithoutParametersKey()
new Options(['config-dir' => 'config', 'root-dir' => FLEX_TEST_DIR])
);
$configurator->configure($recipe, ['locale' => 'en'], $lock);
$this->assertEquals(<<<EOF
$this->assertEquals(<<<'EOF'
parameters:
locale: 'en'

Expand All @@ -91,7 +91,7 @@ public function testConfigureWithoutParametersKey()
, file_get_contents($config));

$configurator->unconfigure($recipe, ['locale' => 'en'], $lock);
$this->assertEquals(<<<EOF
$this->assertEquals(<<<'EOF'
parameters:

services:
Expand Down Expand Up @@ -121,7 +121,7 @@ public function testConfigureWithoutDuplicated()
new Options(['config-dir' => 'config', 'root-dir' => FLEX_TEST_DIR])
);
$configurator->configure($recipe, ['locale' => 'en'], $lock);
$this->assertEquals(<<<EOF
$this->assertEquals(<<<'EOF'
parameters:
locale: es

Expand All @@ -131,7 +131,7 @@ public function testConfigureWithoutDuplicated()
, file_get_contents($config));

$configurator->unconfigure($recipe, ['locale' => 'en'], $lock);
$this->assertEquals(<<<EOF
$this->assertEquals(<<<'EOF'
parameters:

services:
Expand Down Expand Up @@ -165,7 +165,7 @@ public function testConfigureWithComplexContent()
new Options(['config-dir' => 'config', 'root-dir' => FLEX_TEST_DIR])
);
$configurator->configure($recipe, ['locale' => 'en', 'foobar' => 'baz'], $lock);
$this->assertEquals(<<<EOF
$this->assertEquals(<<<'EOF'
parameters:
# comment 1
locale: es
Expand All @@ -180,7 +180,7 @@ public function testConfigureWithComplexContent()
, file_get_contents($config));

$configurator->unconfigure($recipe, ['locale' => 'en', 'foobar' => 'baz'], $lock);
$this->assertEquals(<<<EOF
$this->assertEquals(<<<'EOF'
parameters:
# comment 1

Expand Down Expand Up @@ -215,7 +215,7 @@ public function testConfigureWithComplexContent2()
new Options(['config-dir' => 'config', 'root-dir' => FLEX_TEST_DIR])
);
$configurator->configure($recipe, ['locale' => 'en', 'foobar' => 'baz', 'array' => ['key1' => 'value', 'key2' => "Escape ' one quote"], 'key1' => 'Keep It'], $lock);
$this->assertEquals(<<<EOF
$this->assertEquals(<<<'EOF'
parameters:
# comment 1
locale: es
Expand All @@ -231,7 +231,7 @@ public function testConfigureWithComplexContent2()
, file_get_contents($config));

$configurator->unconfigure($recipe, ['locale' => 'en', 'array' => ['key1' => 'value', 'key2' => "Escape ' one quote"]], $lock);
$this->assertEquals(<<<EOF
parameters:
# comment 1
foobar: 'baz'
Expand Down Expand Up @@ -265,7 +265,7 @@ public function testConfigureWithEnvVariable()
new Options(['config-dir' => 'config', 'root-dir' => FLEX_TEST_DIR])
);
$configurator->configure($recipe, ['env(APP_ENV)' => ''], $lock);
$this->assertEquals(<<<EOF
$this->assertEquals(<<<'EOF'
# comment
parameters:
env(APP_ENV): ''
Expand All @@ -276,7 +276,7 @@ public function testConfigureWithEnvVariable()
, file_get_contents($config));

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

Expand Down
2 changes: 1 addition & 1 deletion tests/Configurator/EnvConfiguratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function testConfigure()

$this->assertStringEqualsFile(
$env,
<<<EOF
<<<'EOF'


EOF
Expand Down
8 changes: 4 additions & 4 deletions tests/Configurator/GitignoreConfiguratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ public function testConfigure()
'/vendor/',
];

$gitignoreContents1 = <<<EOF
$gitignoreContents1 = <<<'EOF'
###> FooBundle ###
.env
/public/bundles/
###< FooBundle ###
EOF;
$gitignoreContents2 = <<<EOF
$gitignoreContents2 = <<<'EOF'
###> BarBundle ###
/var/
/vendor/
Expand Down Expand Up @@ -97,7 +97,7 @@ public function testConfigureForce()
touch($gitignore);
file_put_contents($gitignore, "# preexisting content\n");

$contentsConfigure = <<<EOF
$contentsConfigure = <<<'EOF'
# preexisting content

###> FooBundle ###
Expand All @@ -106,7 +106,7 @@ public function testConfigureForce()

# new content
EOF;
$contentsForce = <<<EOF
$contentsForce = <<<'EOF'
# preexisting content

###> FooBundle ###
Expand Down
4 changes: 2 additions & 2 deletions tests/Configurator/MakefileConfiguratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function testConfigure()

$makefile1 = explode(
"\n",
<<<EOF
<<<'EOF'
CONSOLE := $(shell which bin/console)
sf_console:
ifndef CONSOLE
Expand All @@ -52,7 +52,7 @@ public function testConfigure()
);
$makefile2 = explode(
"\n",
<<<EOF
<<<'EOF'
cache-clear:
ifdef CONSOLE
@$(CONSOLE) cache:clear --no-warmup
Expand Down
2 changes: 1 addition & 1 deletion tests/FlexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function testPostInstall()
$this->assertSame($expected, $postInstallOutput);

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

Expand Down
0