Skip to content

Commit 6434a00

Browse files
Merge branch '2.7' into 2.8
* 2.7: Update JsonBundleReader.php [HttpKernel] Clean test directory on tear down Fix testHtml method with regexp
2 parents daa0251 + f1c65c0 commit 6434a00

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ public function testText()
373373
public function testHtml()
374374
{
375375
$this->assertEquals('<img alt="Bar">', $this->createTestCrawler()->filterXPath('//a[5]')->html());
376-
$this->assertEquals('<input type="text" value="TextValue" name="TextName"><input type="submit" value="FooValue" name="FooName" id="FooId"><input type="button" value="BarValue" name="BarName" id="BarId"><button value="ButtonValue" name="ButtonName" id="ButtonId"></button>', trim($this->createTestCrawler()->filterXPath('//form[@id="FooFormId"]')->html()));
376+
$this->assertEquals('<input type="text" value="TextValue" name="TextName"><input type="submit" value="FooValue" name="FooName" id="FooId"><input type="button" value="BarValue" name="BarName" id="BarId"><button value="ButtonValue" name="ButtonName" id="ButtonId"></button>', trim(preg_replace('~>\s+<~', '><', $this->createTestCrawler()->filterXPath('//form[@id="FooFormId"]')->html())));
377377

378378
try {
379379
$this->createTestCrawler()->filterXPath('//ol')->html();

src/Symfony/Component/HttpKernel/Tests/KernelTest.php

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
16+
use Symfony\Component\Filesystem\Filesystem;
1617
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
1718
use Symfony\Component\HttpKernel\Config\EnvParametersResource;
1819
use Symfony\Component\HttpKernel\Kernel;
@@ -25,6 +26,12 @@
2526

2627
class KernelTest extends TestCase
2728
{
29+
public static function tearDownAfterClass()
30+
{
31+
$fs = new Filesystem();
32+
$fs->remove(__DIR__.'/Fixtures/cache');
33+
}
34+
2835
public function testConstructor()
2936
{
3037
$env = 'test_env';

src/Symfony/Component/Intl/Data/Bundle/Reader/JsonBundleReader.php

+6-9
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,24 @@ public function read($path, $locale)
3232

3333
if (!file_exists($fileName)) {
3434
throw new ResourceBundleNotFoundException(sprintf(
35-
'The resource bundle "%s/%s.json" does not exist.',
36-
$path,
37-
$locale
35+
'The resource bundle "%s" does not exist.',
36+
$fileName
3837
));
3938
}
4039

4140
if (!is_file($fileName)) {
4241
throw new RuntimeException(sprintf(
43-
'The resource bundle "%s/%s.json" is not a file.',
44-
$path,
45-
$locale
42+
'The resource bundle "%s" is not a file.',
43+
$fileName
4644
));
4745
}
4846

4947
$data = json_decode(file_get_contents($fileName), true);
5048

5149
if (null === $data) {
5250
throw new RuntimeException(sprintf(
53-
'The resource bundle "%s/%s.json" contains invalid JSON: %s',
54-
$path,
55-
$locale,
51+
'The resource bundle "%s" contains invalid JSON: %s',
52+
$fileName,
5653
json_last_error_msg()
5754
));
5855
}

0 commit comments

Comments
 (0)