Skip to content

Commit

Permalink
Merge branch '3.2' into 3.3
Browse files Browse the repository at this point in the history
* 3.2:
  fixed tests
  swiftmailer bridge is gone
  [TwigBundle] add back exception check
  Dont call count on non countable object
  Fix undefined variable $filesystem
  • Loading branch information
fabpot committed Jun 24, 2017
2 parents 87601ba + 59094b4 commit 7093fc1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
"Symfony\\Bridge\\Doctrine\\": "src/Symfony/Bridge/Doctrine/",
"Symfony\\Bridge\\Monolog\\": "src/Symfony/Bridge/Monolog/",
"Symfony\\Bridge\\ProxyManager\\": "src/Symfony/Bridge/ProxyManager/",
"Symfony\\Bridge\\Swiftmailer\\": "src/Symfony/Bridge/Swiftmailer/",
"Symfony\\Bridge\\Twig\\": "src/Symfony/Bridge/Twig/",
"Symfony\\Bundle\\": "src/Symfony/Bundle/",
"Symfony\\Component\\": "src/Symfony/Component/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
// remove the assets of the bundles that no longer exist
foreach (new \FilesystemIterator($bundlesDir) as $dir) {
if (!in_array($dir, $validAssetDirs)) {
$filesystem->remove($dir);
$this->filesystem->remove($dir);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected function findTemplate(Request $request, $format, $code, $showException
// default to a generic HTML exception
$request->setRequestFormat('html');

return sprintf('@Twig/Exception/%s.html.twig', $name);
return sprintf('@Twig/Exception/%s.html.twig', $showException ? 'exception_full' : $name);
}

// to be removed when the minimum required version of Twig is >= 3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ public function testFallbackToHtmlIfNoTemplateForRequestedFormat()
$this->assertEquals('html', $request->getRequestFormat());
}

public function testFallbackToHtmlWithFullExceptionIfNoTemplateForRequestedFormatAndExceptionsShouldBeShown()
{
$twig = $this->createTwigEnv(array('@Twig/Exception/exception_full.html.twig' => '<html></html>'));

$request = $this->createRequest('txt');
$request->attributes->set('showException', true);
$exception = FlattenException::create(new \Exception());
$controller = new ExceptionController($twig, false);

$controller->showAction($request, $exception);

$this->assertEquals('html', $request->getRequestFormat());
}

public function testResponseHasRequestedMimeType()
{
$twig = $this->createTwigEnv(array('@Twig/Exception/error.json.twig' => '{}'));
Expand Down
12 changes: 6 additions & 6 deletions src/Symfony/Component/Translation/Dumper/IcuResFileDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti

$resOffset = $this->getPosition($data);

$data .= pack('v', count($messages))
$data .= pack('v', count($messages->all($domain)))
.$indexes
.$this->writePadding($data)
.$resources
Expand All @@ -63,11 +63,11 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti
$root = pack('V7',
$resOffset + (2 << 28), // Resource Offset + Resource Type
6, // Index length
$keyTop, // Index keys top
$bundleTop, // Index resources top
$bundleTop, // Index bundle top
count($messages), // Index max table length
0 // Index attributes
$keyTop, // Index keys top
$bundleTop, // Index resources top
$bundleTop, // Index bundle top
count($messages->all($domain)), // Index max table length
0 // Index attributes
);

$header = pack('vC2v4C12@32',
Expand Down

0 comments on commit 7093fc1

Please sign in to comment.