8000 Merge branch '4.0' · symfony/symfony@b286950 · GitHub
[go: up one dir, main page]

Skip to content

Commit b286950

Browse files
Merge branch '4.0'
* 4.0: [Routing] Fix tests [SecurityBundle] fix test by always disabling CSRF [FrameworkBundle] remove esi/ssi renderers if inactive
2 parents 0b1b895 + a6fa4a3 commit b286950

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ public function testEsiDisabled()
143143
$this->assertFalse($container->hasDefinition('fragment.renderer.esi'), 'The ESI fragment renderer is not registered');
144144
}
145145

146+
public function testEsiInactive()
147+
{
148+
$container = $this->createContainerFromFile('default_config');
149+
150+
$this->assertFalse($container->hasDefinition('fragment.renderer.esi'));
151+
$this->assertFalse($container->hasDefinition('esi'));
152+
}
153+
146154
public function testSsi()
147155
{
148156
$container = $this->createContainerFromFile('full');
@@ -167,6 +175,14 @@ public function testEsiAndSsiWithoutFragments()
167175
$this->assertTrue($container->hasDefinition('fragment.renderer.ssi'), 'The SSI fragment renderer is registered');
168176
}
169177

178+
public function testSsiInactive()
179+
{
180+
$container = $this->createContainerFromFile('default_config');
181+
182+
$this->assertFalse($container->hasDefinition('fragment.renderer.ssi'));
183+
$this->assertFalse($container->hasDefinition('ssi'));
184+
}
185+
170186
public function testEnabledProfiler()
171187
{
172188
$container = $this->createContainerFromFile('profiler');

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private function createContainer($sessionStorageOptions)
121121
);
122122

123123
$ext = new FrameworkExtension();
124-
$ext->load(array(), $container);
124+
$ext->load(array('framework' => array('csrf_protection' => false)), $container);
125125

126126
$ext = new SecurityExtension();
127127
$ext->load($config, $container);

src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function testRedirectPreservesUrlEncoding()
7676
->setConstructorArgs(array(new RequestContext()))
7777
->getMock();
7878

79-
$matcher->expects($this->once())->method('redirect')->with('/foo%3Abar/', 'foo');
79+
$matcher->expects($this->once())->method('redirect')->with('/foo%3Abar/', 'foo')->willReturn(array());
8080

8181
$matcher->match('/foo%3Abar');
8282
}

src/Symfony/Component/Routing/Tests/Matcher/RedirectableUrlMatcherTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function testRedirectPreservesUrlEncoding()
105105
$coll->add('foo', new Route('/foo:bar/'));
106106

107107
$matcher = $this->getMockForAbstractClass('Symfony\Component\Routing\Matcher\RedirectableUrlMatcher', array($coll, new RequestContext()));
108-
$matcher->expects($this->once())->method('redirect')->with('/foo%3Abar/');
108+
$matcher->expects($this->once())->method('redirect')->with('/foo%3Abar/')->willReturn(array());
109109
$matcher->match('/foo%3Abar');
110110
}
111111
}

0 commit comments

Comments
 (0)
0