8000 minor #23670 [DI] use assertStringEqualsFile when possible (nicolas-g… · symfony/symfony@072c866 · GitHub
[go: up one dir, main page]

Skip to content

Commit 072c866

Browse files
minor #23670 [DI] use assertStringEqualsFile when possible (nicolas-grekas)
This PR was merged into the 2.7 branch. Discussion ---------- [DI] use assertStringEqualsFile when possible | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - To make failure reporting more accurate, and maintaining tests easier (assertStringEqualsFile is already heavily used in the same file.) Commits ------- eebae7e [DI] use assertStringEqualsFile when possible
2 parents e5790af + eebae7e commit 072c866

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ public function testAddService()
119119
// without compilation
120120
$container = include self::$fixturesPath.'/containers/container9.php';
121121
$dumper = new PhpDumper($container);
122-
$this->assertEquals(str_replace('%path%', str_replace('\\', '\\\\', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), file_get_contents(self::$fixturesPath.'/php/services9.php')), $dumper->dump(), '->dump() dumps services');
122+
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services9.php', str_replace(str_replace('\\', '\\\\', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), '%path%', $dumper->dump()), '->dump() dumps services');
123123

124124
// with compilation
125125
$container = include self::$fixturesPath.'/containers/container9.php';
126126
$container->compile();
127127
$dumper = new PhpDumper($container);
128-
$this->assertEquals(str_replace('%path%', str_replace('\\', '\\\\', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), file_get_contents(self::$fixturesPath.'/php/services9_compiled.php')), $dumper->dump(), '->dump() dumps services');
128+
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services9_compiled.php', str_replace(str_replace('\\', '\\\\', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), '%path%', $dumper->dump()), '->dump() dumps services');
129129

130130
$dumper = new PhpDumper($container = new ContainerBuilder());
131131
$container->register('foo', 'FooClass')->addArgument(new \stdClass());
@@ -145,7 +145,7 @@ public function testLegacySynchronizedServices()
145145
{
146146
$container = include self::$fixturesPath.'/containers/container20.php';
147147
$dumper = new PhpDumper($container);
148-
$this->assertEquals(str_replace('%path%', str_replace('\\', '\\\\', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), file_get_contents(self::$fixturesPath.'/php/services20.php')), $dumper->dump(), '->dump() dumps services');
148+
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services20.php', str_replace(str_replace('\\', '\\\\', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), '%path%', $dumper->dump()), '->dump() dumps services');
149149
}
150150

151151
public function testServicesWithAnonymousFactories()

0 commit comments

Comments
 (0)
0