8000 Merge branch '2.7' into 2.8 · symfony/symfony@ee8203a · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit ee8203a

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: [TwigBridge] removed deprecations added in Twig 1.27 PHP CS Fixer: use php_unit_dedicate_assert fixed Filesystem:makePathRelative and added 2 more testcases no 304 response if method is not cacheable move tags from decorated to decorating service
2 parents adf20c8 + ef48f59 commit ee8203a

File tree

28 files changed

+80
-50
lines changed

28 files changed

+80
-50
lines changed

.php_cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ return Symfony\CS\Config\Config::create()
66
->fixers(array(
77
'long_array_syntax',
88
'php_unit_construct',
9+
'php_unit_dedicate_assert',
910
))
1011
->finder(
1112
Symfony\CS\Finder\DefaultFinder::create()

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=5.3.9",
2020
"doctrine/common": "~2.4",
21-
"twig/twig": "~1.26|~2.0",
21+
"twig/twig": "~1.27|~2.0",
2222
"psr/log": "~1.0",
2323
"symfony/security-acl": "~2.7|~3.0.0",
2424
"symfony/polyfill-apcu": "~1.1",

src/Symfony/Bridge/Twig/Command/LintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private function validate(\Twig_Environment $twig, $template, $file)
147147
try {
148148
$temporaryLoader = new \Twig_Loader_Array(array((string) $file => $template));
149149
$twig->setLoader($temporaryLoader);
150-
$nodeTree = $twig->parse($twig->tokenize($template, (string) $file));
150+
$nodeTree = $twig->parse($twig->tokenize(new \Twig_Source($template, (string) $file)));
151151
$twig->compile($nodeTree);
152152
$twig->setLoader($realLoader);
153153
} catch (\Twig_Error $e) {

src/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function testEscaping($template, $mustBeEscaped)
2323
$twig = new \Twig_Environment($this->getMock('Twig_LoaderInterface'), array('debug' => true, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0));
2424
$twig->addExtension(new RoutingExtension($this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface')));
2525

26-
$nodes = $twig->parse($twig->tokenize($template));
26+
$nodes = $twig->parse($twig->tokenize(new \Twig_Source($template)));
2727

2828
$this->assertSame($mustBeEscaped, $nodes->getNode('body')->getNode(0)->getNode('expr') instanceof \Twig_Node_Expression_Filter);
2929
}

src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testTrans($template, $expected, array $variables = array())
3636
$twig = new \Twig_Environment($loader, array('debug' => true, 'cache' => false));
3737
$twig->addExtension(new TranslationExtension(new Translator('en', new MessageSelector())));
3838

39-
echo $twig->compile($twig->parse($twig->tokenize($twig->getLoader()->getSource('index'), 'index')))."\n\n";
39+
echo $twig->compile($twig->parse($twig->tokenize(new \Twig_Source($twig->getLoader()->getSource('index'), 'index'))))."\n\n";
4040
$this->assertEquals($expected, $this->getTemplate($template)->render($variables));
4141
}
4242

src/Symfony/Bridge/Twig/Tests/NodeVisitor/TwigNodeProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static function getModule($content)
2525
new \Twig_Node_Expression_Array(array(), 0),
2626
new \Twig_Node_Expression_Array(array(), 0),
2727
null,
28-
null
28+
new \Twig_Source('')
2929
);
3030
}
3131

src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function testCompile($source, $expected)
2323
{
2424
$env = new \Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false, 'optimizations' => 0));
2525
$env->addTokenParser(new FormThemeTokenParser());
26-
$stream = $env->tokenize($source);
26+
$stream = $env->tokenize(new \Twig_Source($source));
2727
$parser = new \Twig_Parser($env);
2828

2929
$this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0));

src/Symfony/Bridge/Twig/TokenParser/TransChoiceTokenParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function parse(\Twig_Token $token)
6464
$body = $this->parser->subparse(array($this, 'decideTransChoiceFork'), true);
6565

6666
if (!$body instanceof \Twig_Node_Text && !$body instanceof \Twig_Node_Expression) {
67-
throw new \Twig_Error_Syntax('A message inside a transchoice tag must be a simple text.', $body->getLine(), $stream->getFilename());
67+
throw new \Twig_Error_Syntax('A message inside a transchoice tag must be a simple text.', $body->getLine(), $stream->getSourceContext()->getName());
6868
}
6969

7070
$stream->expect(\Twig_Token::BLOCK_END_TYPE);

src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function parse(\Twig_Token $token)
5555
$stream->next();
5656
$locale = $this->parser->getExpressionParser()->parseExpression();
5757
} elseif (!$stream->test(\Twig_Token::BLOCK_END_TYPE)) {
58-
throw new \Twig_Error_Syntax('Unexpected token. Twig was looking for the "with", "from", or "into" keyword.', $stream->getCurrent()->getLine(), $stream->getFilename());
58+
throw new \Twig_Error_Syntax('Unexpected token. Twig was looking for the "with", "from", or "into" keyword.', $stream->getCurrent()->getLine(), $stream->getSourceContext()->getName());
5959
}
6060
}
6161

@@ -64,7 +64,7 @@ public function parse(\Twig_Token $token)
6464
$body = $this->parser->subparse(array($this, 'decideTransFork'), true);
6565

6666
if (!$body instanceof \Twig_Node_Text && !$body instanceof \Twig_Node_Expression) {
67-
throw new \Twig_Error_Syntax('A message inside a trans tag must be a simple text.', $body->getLine(), $stream->getFilename());
67+
throw new \Twig_Error_Syntax('A message inside a trans tag must be a simple text.', $body->getLine(), $stream->getSourceContext()->getName());
6868
}
6969

7070
$stream->expect(\Twig_Token::BLOCK_END_TYPE);

src/Symfony/Bridge/Twig/Translation/TwigExtractor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public function extract($resource, MessageCatalogue $catalogue)
6262
$this->extractTemplate(file_get_contents($file->getPathname()), $catalogue);
6363
} catch (\Twig_Error $e) {
6464
if ($file instanceof SplFileInfo) {
65-
$e->setTemplateFile($file->getRelativePathname());
65+
$e->setTemplateName($file->getRelativePathname());
6666
} elseif ($file instanceof \SplFileInfo) {
67-
$e->setTemplateFile($file->getRealPath());
67+
$e->setTemplateName($file->getRealPath());
6868
}
6969

7070
throw $e;
@@ -85,7 +85,7 @@ protected function extractTemplate($template, MessageCatalogue $catalogue)
8585
$visitor = $this->twig->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->getTranslationNodeVisitor();
8686
$visitor->enable();
8787

88-
$this->twig->parse($this->twig->tokenize($template));
88+
$this->twig->parse($this->twig->tokenize(new \Twig_Source($template)));
8989

9090
foreach ($visitor->getMessages() as $message) {
9191
$catalogue->set(trim($message[0]), $this->prefix.trim($message[0]), $message[1] ?: $this->defaultDomain);

src/Symfony/Bridge/Twig/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=5.3.9",
20-
"twig/twig": "~1.26|~2.0"
20+
"twig/twig": "~1.27|~2.0"
2121
},
2222
"require-dev": {
2323
"symfony/asset": "~2.7|~3.0.0",

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testProfilerIsDisabled($insulate)
3030
$client->enableProfiler();
3131
$crawler = $client->request('GET', '/profiler');
3232
$profile = $client->getProfile();
33-
$this->assertTrue(is_object($profile));
33+
$this->assertInternalType('object', $profile);
3434

3535
$client->request('GET', '/profiler');
3636
$this->assertFalse($client->getProfile());

src/Symfony/Bundle/SecurityBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"symfony/yaml": "~2.0,>=2.0.5|~3.0.0",
3838
"symfony/expression-language": "~2.6|~3.0.0",
3939
"doctrine/doctrine-bundle": "~1.2",
40-
"twig/twig": "~1.26|~2.0"
40+
"twig/twig": "~1.27|~2.0"
4141
},
4242
"autoload": {
4343
"psr-4": { "Symfony\\Bundle\\SecurityBundle\\": "" },

src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ private function addTwigOptions(ArrayNodeDefinition $rootNode)
167167
$rootNode
168168
->fixXmlConfig('path')
169169
->children()
170-
->variableNode('autoescape')->defaultValue('filename')->end()
170+
->variableNode('autoescape')->defaultValue('name')->end()
171171
->scalarNode('autoescape_service')->defaultNull()->end()
172172
->scalarNode('autoescape_service_method')->defaultNull()->end()
173173
->scalarNode('base_template_class')->example('Twig_Template')->cannotBeEmpty()->end()

src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function testLoadDefaultTemplateEscapingGuesserConfiguration($format)
147147
$this->compileContainer($container);
148148

149149
$options = $container->getDefinition('twig')->getArgument(1);
150-
$this->assertEquals('filename', $options['autoescape']);
150+
$this->assertEquals('name', $options['autoescape']);
151151
}
152152

153153
public function testGlobalsWithDifferentTypesAndValues()

src/Symfony/Bundle/TwigBundle/Tests/Functional/CacheWarmingTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testCacheIsProperlyWarmedWhenTemplatingIsAvailable()
2828
$warmer->enableOptionalWarmers();
2929
$warmer->warmUp($kernel->getCacheDir());
3030

31-
$this->assertTrue(file_exists($kernel->getCacheDir().'/twig'));
31+
$this->assertFileExists($kernel->getCacheDir().'/twig');
3232
}
3333

3434
public function testCacheIsProperlyWarmedWhenTemplatingIsDisabled()
@@ -40,7 +40,7 @@ public function testCacheIsProperlyWarmedWhenTemplatingIsDisabled()
4040
$warmer->enableOptionalWarmers();
4141
$warmer->warmUp($kernel->getCacheDir());
4242

43-
$this->assertTrue(file_exists($kernel->getCacheDir().'/twig'));
43+
$this->assertFileExists($kernel->getCacheDir().'/twig');
4444
}
4545

4646
protected function setUp()

src/Symfony/Bundle/TwigBundle/Tests/TokenParser/LegacyRenderTokenParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function testCompile($source, $expected)
2727
{
2828
$env = new \Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false, 'optimizations' => 0));
2929
$env->addTokenParser(new RenderTokenParser());
30-
$stream = $env->tokenize($source);
30+
$stream = $env->tokenize(new \Twig_Source($source));
3131
$parser = new \Twig_Parser($env);
3232

3333
$this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0));

src/Symfony/Bundle/TwigBundle/TwigEngine.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ public function setDefaultEscapingStrategy($strategy)
5454

5555
/**
5656
* @deprecated since version 2.7, to be removed in 3.0.
57-
* Use the 'filename' strategy instead.
57+
* Use the 'name' strategy instead.
5858
*/
59-
public function guessDefaultEscapingStrategy($filename)
59+
public function guessDefaultEscapingStrategy($name)
6060
{
6161
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.7 and will be removed in 3.0. Use the Twig_FileExtensionEscapingStrategy::guess method instead.', E_USER_DEPRECATED);
6262

63-
return \Twig_FileExtensionEscapingStrategy::guess($filename);
63+
return \Twig_FileExtensionEscapingStrategy::guess($name);
6464
}
6565

6666
/**
@@ -73,8 +73,8 @@ public function render($name, array $parameters = array())
7373
} catch (\Twig_Error $e) {
7474
if ($name instanceof TemplateReference) {
7575
try {
76-
// try to get the real file name of the template where the error occurred
77-
$e->setTemplateFile(sprintf('%s', $this->locator->locate($this->parser->parse($e->getTemplateFile()))));
76+
// try to get the real name of the template where the error occurred
77+
$e->setTemplateName(sprintf('%s', $this->locator->locate($this->parser->parse($e->getTemplateName()))));
7878
} catch (\Exception $e2) {
7979
}
8080
}

src/Symfony/Bundle/TwigBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"symfony/twig-bridge": "~2.7|~3.0.0",
2222
"symfony/http-foundation": "~2.5|~3.0.0",
2323
"symfony/http-kernel": "~2.7",
24-
"twig/twig": "~1.26|~2.0"
24+
"twig/twig": "~1.27|~2.0"
2525
},
2626
"require-dev": {
2727
"symfony/stopwatch": "~2.2|~3.0.0",

src/Symfony/Component/DependencyInjection/Compiler/DecoratorServicePass.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ public function process(ContainerBuilder $container)
5252
$public = $alias->isPublic();
5353
$container->setAlias($renamedId, new Alias((string) $alias, false));
5454
} else {
55-
$definition = $container->getDefinition($inner);
56-
$public = $definition->isPublic();
57-
$definition->setPublic(false);
58-
$container->setDefinition($renamedId, $definition);
55+
$decoratedDefinition = $container->getDefinition($inner);
56+
$definition->setTags($decoratedDefinition->getTags(), $definition->getTags());
57+
$public = $decoratedDefinition->isPublic();
58+
$decoratedDefinition->setPublic(false);
59+
$decoratedDefinition->setTags(array());
60+
$container->setDefinition($renamedId, $decoratedDefinition);
5961
}
6062

6163
$container->setAlias($inner, new Alias($id, $public));

src/Symfony/Component/DependencyInjection/Tests/Compiler/DecoratorServicePassTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,24 @@ public function testProcessWithPriority()
124124
$this->assertNull($quxDefinition->getDecoratedService());
125125
}
126126

127+
public function testProcessMovesTagsFromDecoratedDefinitionToDecoratingDefinition()
128+
{
129+
$container = new ContainerBuilder();
130+
$container
131+
->register('foo')
132+
->setTags(array('name' => 'bar'))
133+
;
134+
$container
135+
->register('baz')
136+
->setDecoratedService('foo')
137+
;
138+
139+
$this->process($container);
140+
141+
$this->assertEmpty($container->getDefinition('baz.inner')->getTags());
142+
$this->assertEquals(array('name' => 'bar'), $container->getDefinition('baz')->getTags());
143+
}
144+
127145
protected function process(ContainerBuilder $container)
128146
{
129147
$repeatedPass = new DecoratorServicePass();

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,14 @@ public function makePathRelative($endPath, $startPath)
369369
}
370370

371371
// Determine how deep the start path is relative to the common path (ie, "web/bundles" = 2 levels)
372-
$depth = count($startPathArr) - $index;
372+
if (count($startPathArr) === 1 && $startPathArr[0] === '') {
373+
$depth = 0;
374+
} else {
375+
$depth = count($startPathArr) - $index;
376+
}
373377

374378
// When we need to traverse from the start, and we are starting from a root path, don't add '../'
375-
if ('/' === $startPath[0] && 0 === $index && 1 === $depth) {
379+
if ('/' === $startPath[0] && 0 === $index && 0 === $depth) {
376380
$traverser = '';
377381
} else {
378382
// Repeated "../" for each level need to reach the common path

src/Symfony/Component/Filesystem/Tests/FilesystemTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ public function providePathsForMakePathRelative()
840840
array('/a/aab/bb/', '/a/aa/', '../aab/bb/'),
841841
array('/a/aab/bb/', '/', 'a/aab/bb/'),
842842
array('/a/aab/bb/', '/b/aab', '../../a/aab/bb/'),
843+
array('/aab/bb', '/aa', '../aab/bb/'),
844+
array('/aab', '/aa', '../aab/'),
843845
);
844846

845847
if ('\\' === DIRECTORY_SEPARATOR) {

src/Symfony/Component/Form/Tests/Extension/Validator/Type/BaseValidatorExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testValidationGroupsCanBeSetToCallback()
5858
'validation_groups' => array($this, 'testValidationGroupsCanBeSetToCallback'),
5959
));
6060

61-
$this->assertTrue(is_callable($form->getConfig()->getOption('validation_groups')));
61+
$this->assertInternalType('callable', $form->getConfig()->getOption('validation_groups'));
6262
}
6363

6464
public function testValidationGroupsCanBeSetToClosure()
@@ -67,7 +67,7 @@ public function testValidationGroupsCanBeSetToClosure()
6767
'validation_groups' => function (FormInterface $form) { },
6868
));
6969

70-
$this->assertTrue(is_callable($form->getConfig()->getOption('validation_groups')));
70+
$this->assertInternalType('callable', $form->getConfig()->getOption('validation_groups'));
7171
}
7272

7373
abstract protected function createForm(array $options = array());

src/Symfony/Component/HttpFoundation/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ public function setVary($headers, $replace = true)
10041004
*/
10051005
public function isNotModified(Request $request)
10061006
{
1007-
if (!$request->isMethodSafe()) {
1007+
if (!$request->isMethodCacheable()) {
10081008
return false;
10091009
}
10101010

src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,24 @@ public function dump(Data $data)
9797

9898
break;
9999
} elseif (isset($trace[$i]['object']) && $trace[$i]['object'] instanceof \Twig_Template) {
100-
$info = $trace[$i]['object'];
101-
$name = $info->getTemplateName();
102-
$src = method_exists($info, 'getSource') ? $info->getSource() : $info->getEnvironment()->getLoader()->getSource($name);
103-
$info = $info->getDebugInfo();
100+
$template = $trace[$i]['object'];
101+
$name = $template->getTemplateName();
102+
$file = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getPath() : false;
103+
$src = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : false);
104+
$info = $template->getDebugInfo();
104105
if (null !== $src && isset($info[$trace[$i - 1]['line']])) {
105-
$file = false;
106106
$line = $info[$trace[$i - 1]['line']];
107-
$src = explode("\n", $src);
108-
$fileExcerpt = array();
109107

110-
for ($i = max($line - 3, 1), $max = min($line + 3, count($src)); $i <= $max; ++$i) {
111-
$fileExcerpt[] = '<li'.($i === $line ? ' class="selected"' : '').'><code>'.$this->htmlEncode($src[$i - 1]).'</code></li>';
112-
}
108+
if ($src) {
109+
$src = explode("\n", $src);
110+
$fileExcerpt = array();
111+
112+
for ($i = max($line - 3, 1), $max = min($line + 3, count($src)); $i <= $max; ++$i) {
113+
$fileExcerpt[] = '<li'.($i === $line ? ' class="selected"' : '').'><code>'.$this->htmlEncode($src[$i - 1]).'</code></li>';
114+
}
113115

114-
$fileExcerpt = '<ol start="'.max($line - 3, 1).'">'.implode("\n", $fileExcerpt).'</ol>';
116+
$fileExcerpt = '<ol start="'.max($line - 3, 1).'">'.implode("\n", $fileExcerpt).'</ol>';
117+
}
115118
}
116119
break;
117120
}

src/Symfony/Component/OptionsResolver/Tests/LegacyOptionsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public function testOverloadCannotBeEvaluatedLazilyWithoutExpectedClosureParams(
275275
});
276276

277277
$resolved = $this->options->resolve();
278-
$this->assertTrue(is_callable($resolved['foo']));
278+
$this->assertInternalType('callable', $resolved['foo']);
279279
}
280280

281281
public function testOverloadCannotBeEvaluatedLazilyWithoutFirstParamTypeHint()
@@ -287,7 +287,7 @@ public function testOverloadCannotBeEvaluatedLazilyWithoutFirstParamTypeHint()
287287
});
288288

289289
$resolved = $this->options->resolve();
290-
$this->assertTrue(is_callable($resolved['foo']));
290+
$this->assertInternalType('callable', $resolved['foo']);
291291
}
292292

293293
public function testRemoveOptionAndNormalizer()

src/Symfony/Component/Translation/Tests/Dumper/FileDumperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testDumpBackupsFileIfExisting()
4343
$dumper = new ConcreteFileDumper();
4444
$dumper->dump($catalogue, array('path' => $tempDir));
4545

46-
$this->assertTrue(file_exists($backupFile));
46+
$this->assertFileExists($backupFile);
4747

4848
@unlink($file);
4949
@unlink($backupFile);
@@ -62,7 +62,7 @@ public function testDumpCreatesNestedDirectoriesAndFile()
6262
$dumper->setRelativePathTemplate('test/translations/%domain%.%locale%.%extension%');
6363
$dumper->dump($catalogue, array('path' => $tempDir));
6464

65-
$this->assertTrue(file_exists($file));
65+
$this->assertFileExists($file);
6666

6767
@unlink($file);
6868
@rmdir($translationsDir);

0 commit comments

Comments
 (0)
0