Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e891d55

Browse filesBrowse files
committed
Merge branch '3.3' into 3.4
* 3.3: fixed tests swiftmailer bridge is gone respect the API in FirewallContext map [TwigBundle] add back exception check Dont call count on non countable object Fix undefined variable $filesystem
2 parents 265fc2a + 7093fc1 commit e891d55
Copy full SHA for e891d55

File tree

Expand file treeCollapse file tree

6 files changed

+37
-14
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+37
-14
lines changed

‎composer.json

Copy file name to clipboardExpand all lines: composer.json
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@
115115
"Symfony\\Bridge\\Doctrine\\": "src/Symfony/Bridge/Doctrine/",
116116
"Symfony\\Bridge\\Monolog\\": "src/Symfony/Bridge/Monolog/",
117117
"Symfony\\Bridge\\ProxyManager\\": "src/Symfony/Bridge/ProxyManager/",
118-
"Symfony\\Bridge\\Swiftmailer\\": "src/Symfony/Bridge/Swiftmailer/",
119118
"Symfony\\Bridge\\Twig\\": "src/Symfony/Bridge/Twig/",
120119
"Symfony\\Bundle\\": "src/Symfony/Bundle/",
121120
"Symfony\\Component\\": "src/Symfony/Component/"

‎src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
158158
// remove the assets of the bundles that no longer exist
159159
foreach (new \FilesystemIterator($bundlesDir) as $dir) {
160160
if (!in_array($dir, $validAssetDirs)) {
161-
$filesystem->remove($dir);
161+
$this->filesystem->remove($dir);
162162
}
163163
}
164164

‎src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallMapTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallMapTest.php
+15-5Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@
1212
namespace Symfony\Bundle\SecurityBundle\Tests\Security;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bundle\SecurityBundle\Security\FirewallConfig;
1516
use Symfony\Bundle\SecurityBundle\Security\FirewallContext;
1617
use Symfony\Bundle\SecurityBundle\Security\FirewallMap;
1718
use Symfony\Component\DependencyInjection\Container;
1819
use Symfony\Component\HttpFoundation\Request;
1920
use Symfony\Component\HttpFoundation\RequestMatcherInterface;
21+
use Symfony\Component\Security\Core\User\UserCheckerInterface;
22+
use Symfony\Component\Security\Http\Firewall\ExceptionListener;
23+
use Symfony\Component\Security\Http\Firewall\ListenerInterface;
2024

2125
class FirewallMapTest extends TestCase
2226
{
@@ -58,9 +62,15 @@ public function testGetListeners()
5862
$request = new Request();
5963

6064
$firewallContext = $this->getMockBuilder(FirewallContext::class)->disableOriginalConstructor()->getMock();
61-
$firewallContext->expects($this->once())->method('getConfig')->willReturn('CONFIG');
62-
$firewallContext->expects($this->once())->method('getListeners')->willReturn('LISTENERS');
63-
$firewallContext->expects($this->once())->method('getExceptionListener')->willReturn('EXCEPTION LISTENER');
65+
66+
$firewallConfig = new FirewallConfig('main', $this->getMockBuilder(UserCheckerInterface::class)->getMock());
67+
$firewallContext->expects($this->once())->method('getConfig')->willReturn($firewallConfig);
68+
69+
$listener = $this->getMockBuilder(ListenerInterface::class)->getMock();
70+
$firewallContext->expects($this->once())->method('getListeners')->willReturn(array($listener));
71+
72+
$exceptionListener = $this->getMockBuilder(ExceptionListener::class)->disableOriginalConstructor()->getMock();
73+
$firewallContext->expects($this->once())->method('getExceptionListener')->willReturn($exceptionListener);
6474

6575
$matcher = $this->getMockBuilder(RequestMatcherInterface::class)->getMock();
6676
$matcher->expects($this->once())
@@ -73,8 +83,8 @@ public function testGetListeners()
7383

7484
$firewallMap = new FirewallMap($container, array('security.firewall.map.context.foo' => $matcher));
7585

76-
$this->assertEquals(array('LISTENERS', 'EXCEPTION LISTENER'), $firewallMap->getListeners($request));
77-
$this->assertEquals('CONFIG', $firewallMap->getFirewallConfig($request));
86+
$this->assertEquals(array(array($listener), $exceptionListener), $firewallMap->getListeners($request));
87+
$this->assertEquals($firewallConfig, $firewallMap->getFirewallConfig($request));
7888
$this->assertEquals('security.firewall.map.context.foo', $request->attributes->get(self::ATTRIBUTE_FIREWALL_CONTEXT));
7989
}
8090
}

‎src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ protected function findTemplate(Request $request, $format, $code, $showException
123123
// default to a generic HTML exception
124124
$request->setRequestFormat('html');
125125

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

129129
// to be removed when the minimum required version of Twig is >= 3.0

‎src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ public function testFallbackToHtmlIfNoTemplateForRequestedFormat()
4848
$this->assertEquals('html', $request->getRequestFormat());
4949
}
5050

51+
public function testFallbackToHtmlWithFullExceptionIfNoTemplateForRequestedFormatAndExceptionsShouldBeShown()
52+
{
53+
$twig = $this->createTwigEnv(array('@Twig/Exception/exception_full.html.twig' => '<html></html>'));
54+
55+
$request = $this->createRequest('txt');
56+
$request->attributes->set('showException', true);
57+
$exception = FlattenException::create(new \Exception());
58+
$controller = new ExceptionController($twig, false);
59+
60+
$controller->showAction($request, $exception);
61+
62+
$this->assertEquals('html', $request->getRequestFormat());
63+
}
64+
5165
public function testResponseHasRequestedMimeType()
5266
{
5367
$twig = $this->createTwigEnv(array('@Twig/Exception/error.json.twig' => '{}'));

‎src/Symfony/Component/Translation/Dumper/IcuResFileDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Translation/Dumper/IcuResFileDumper.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti
5252

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

55-
$data .= pack('v', count($messages))
55+
$data .= pack('v', count($messages->all($domain)))
5656
.$indexes
5757
.$this->writePadding($data)
5858
.$resources
@@ -63,11 +63,11 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti
6363
$root = pack('V7',
6464
$resOffset + (2 << 28), // Resource Offset + Resource Type
6565
6, // Index length
66-
$keyTop, // Index keys top
67-
$bundleTop, // Index resources top
68-
$bundleTop, // Index bundle top
69-
count($messages), // Index max table length
70-
0 // Index attributes
66+
$keyTop, // Index keys top
67+
$bundleTop, // Index resources top
68+
$bundleTop, // Index bundle top
69+
count($messages->all($domain)), // Index max table length
70+
0 // Index attributes
7171
);
7272

7373
$header = pack('vC2v4C12@32',

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.