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

Skip to content

Commit 0cd725e

Browse files
committed
Merge branch '2.3' into 2.7
2 parents 058dee7 + 89f1c35 commit 0cd725e

File tree

5 files changed

+46
-21
lines changed

5 files changed

+46
-21
lines changed

src/Symfony/Component/Form/DataTransformerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function transform($value);
5858
*
5959
* This method must be able to deal with empty values. Usually this will
6060
* be an empty string, but depending on your implementation other empty
61-
* values are possible as well (such as empty strings). The reasoning behind
61+
* values are possible as well (such as NULL). The reasoning behind
6262
* this is that value transformers must be chainable. If the
6363
* reverseTransform() method of the first value transformer outputs an
6464
* empty string, the second value transformer must be able to process that

src/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ public function testAutoloadMainExtension()
1919
{
2020
$container = $this->getMock(
2121
'Symfony\\Component\\DependencyInjection\\ContainerBuilder',
22-
array('getExtensionConfig', 'loadFromExtension', 'getParameterBag')
22+
array(
23+
'getExtensionConfig',
24+
'loadFromExtension',
25+
'getParameterBag',
26+
'getDefinitions',
27+
'getAliases',
28+
'getExtensions',
29+
)
2330
);
2431
$params = $this->getMock('Symfony\\Component\\DependencyInjection\\ParameterBag\\ParameterBag');
2532

src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ public function testSubRequestWithDifferentMethod()
112112
->will($this->returnValue(array()));
113113

114114
$context = new RequestContext();
115-
$requestMatcher->expects($this->any())
116-
->method('getContext')
117-
->will($this->returnValue($context));
118115

119116
$listener = new RouterListener($requestMatcher, new RequestContext(), null, $this->requestStack);
120117
$listener->onKernelRequest($event);

src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\HttpKernel\HttpCache\HttpCache;
1515
use Symfony\Component\HttpFoundation\Request;
1616
use Symfony\Component\HttpFoundation\Response;
17+
use Symfony\Component\HttpKernel\HttpKernelInterface;
1718

1819
/**
1920
* @group time-sensitive
@@ -27,15 +28,11 @@ public function testTerminateDelegatesTerminationOnlyForTerminableInterface()
2728
->getMock();
2829

2930
// does not implement TerminableInterface
30-
$kernelMock = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\HttpKernelInterface')
31-
->disableOriginalConstructor()
32-
->getMock();
33-
34-
$kernelMock->expects($this->never())
35-
->method('terminate');
31+
$kernel = new TestKernel();
32+
$httpCache = new HttpCache($kernel, $storeMock);
33+
$httpCache->terminate(Request::create('/'), new Response());
3634

37-
$kernel = new HttpCache($kernelMock, $storeMock);
38-
$kernel->terminate(Request::create('/'), new Response());
35+
$this->assertFalse($kernel->terminateCalled, 'terminate() is never called if the kernel class does not implement TerminableInterface');
3936

4037
// implements TerminableInterface
4138
$kernelMock = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\Kernel')
@@ -1228,3 +1225,17 @@ public function testEsiCacheRemoveValidationHeadersIfEmbeddedResponses()
12281225
$this->assertNull($this->response->getLastModified());
12291226
}
12301227
}
1228+
1229+
class TestKernel implements HttpKernelInterface
1230+
{
1231+
public $terminateCalled = false;
1232+
1233+
public function terminate(Request $request, Response $response)
1234+
{
1235+
$this->terminateCalled = true;
1236+
}
1237+
1238+
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true)
1239+
{
1240+
}
1241+
}

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

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -730,22 +730,18 @@ public function testTerminateReturnsSilentlyIfKernelIsNotBooted()
730730
public function testTerminateDelegatesTerminationOnlyForTerminableInterface()
731731
{
732732
// does not implement TerminableInterface
733-
$httpKernelMock = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')
734-
->disableOriginalConstructor()
735-
->getMock();
736-
737-
$httpKernelMock
738-
->expects($this->never())
739-
->method('terminate');
733+
$httpKernel = new TestKernel();
740734

741735
$kernel = $this->getKernel(array('getHttpKernel'));
742736
$kernel->expects($this->once())
743737
->method('getHttpKernel')
744-
->will($this->returnValue($httpKernelMock));
738+
->willReturn($httpKernel);
745739

746740
$kernel->boot();
747741
$kernel->terminate(Request::create('/'), new Response());
748742

743+
$this->assertFalse($httpKernel->terminateCalled, 'terminate() is never called if the kernel class does not implement TerminableInterface');
744+
749745
// implements TerminableInterface
750746
$httpKernelMock = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernel')
751747
->disableOriginalConstructor()
@@ -847,3 +843,17 @@ protected function getKernelForTest(array $methods = array())
847843
return $kernel;
848844
}
849845
}
846+
847+
class TestKernel implements HttpKernelInterface
848+
{
849+
public $terminateCalled = false;
850+
851+
public function terminate()
852+
{
853+
$this->terminateCalled = true;
854+
}
855+
856+
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true)
857+
{
858+
}
859+
}

0 commit comments

Comments
 (0)
0