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 76d3c9e

Browse filesBrowse files
committed
Merge branch '2.4' into 2.5
* 2.4: fixed previous merge Added missing `break` statement don't disable constructor calls to mockups of classes that extend internal PHP classes Small comment update according to PSR-2 [Console] Fixed notice in DialogHelper [HttpFoundation] Fixed Request::getPort returns incorrect value under IPv6 [Filesystem] Fix test suite on OSX Add framework-bundle Conflicts: src/Symfony/Bundle/TwigBundle/composer.json
2 parents a50aca0 + f2bdc22 commit 76d3c9e
Copy full SHA for 76d3c9e

File tree

Expand file treeCollapse file tree

13 files changed

+56
-27
lines changed
Filter options
Expand file treeCollapse file tree

13 files changed

+56
-27
lines changed

‎src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ protected function createEntityManagerMock($repositoryMock)
6363
->method('hasField')
6464
->will($this->returnValue(true))
6565
;
66-
$refl = $this->getMockBuilder('Doctrine\Common\Reflection\StaticReflectionProperty')
66+
$reflParser = $this->getMockBuilder('Doctrine\Common\Reflection\StaticReflectionParser')
6767
->disableOriginalConstructor()
68+
->getMock()
69+
;
70+
$refl = $this->getMockBuilder('Doctrine\Common\Reflection\StaticReflectionProperty')
71+
->setConstructorArgs(array($reflParser, 'property-name'))
6872
->setMethods(array('getValue'))
6973
->getMock()
7074
;

‎src/Symfony/Bundle/TwigBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/composer.json
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"symfony/dependency-injection": "~2.0",
2626
"symfony/config": "~2.2",
2727
"symfony/routing": "~2.1",
28-
"symfony/templating": "~2.1"
28+
"symfony/templating": "~2.1",
29+
"symfony/framework-bundle": "~2.1"
2930
},
3031
"autoload": {
3132
"psr-0": { "Symfony\\Bundle\\TwigBundle\\": "" }

‎src/Symfony/Component/Console/Helper/DialogHelper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Helper/DialogHelper.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function ask(OutputInterface $output, $question, $default = null, array $
157157
$c .= fread($inputStream, 2);
158158

159159
// A = Up Arrow. B = Down Arrow
160-
if ('A' === $c[2] || 'B' === $c[2]) {
160+
if (isset($c[2]) && ('A' === $c[2] || 'B' === $c[2])) {
161161
if ('A' === $c[2] && -1 === $ofs) {
162162
$ofs = 0;
163163
}

‎src/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ protected function getFileGroup($filepath)
9696
if ($datas = posix_getgrgid($infos['gid'])) {
9797
return $datas['name'];
9898
}
99+
100+
$this->markTestSkipped('Unable to retrieve file group name');
99101
}
100102

101103
protected function markAsSkippedIfSymlinkIsMissing()

‎src/Symfony/Component/Finder/Adapter/AbstractFindAdapter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Adapter/AbstractFindAdapter.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ private function buildSizesFiltering(Command $command, array $sizes)
256256
case '!=':
257257
$command->add('-size -'.$size->getTarget().'c');
258258
$command->add('-size +'.$size->getTarget().'c');
259+
break;
259260
case '<':
260261
default:
261262
$command->add('-size -'.$size->getTarget().'c');

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private function createUploadedFileMock($name, $originalName, $valid)
7878
{
7979
$file = $this
8080
->getMockBuilder('Symfony\Component\HttpFoundation\File\UploadedFile')
81-
->disableOriginalConstructor()
81+
->setConstructorArgs(array(__DIR__.'/../../../Fixtures/foo', 'foo'))
8282
->getMock()
8383
;
8484
$file

‎src/Symfony/Component/Form/Tests/Extension/HttpFoundation/HttpFoundationRequestHandlerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/HttpFoundation/HttpFoundationRequestHandlerTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function getRequestHandler()
4848
protected function getMockFile()
4949
{
5050
return $this->getMockBuilder('Symfony\Component\HttpFoundation\File\UploadedFile')
51-
->disableOriginalConstructor()
51+
->setConstructorArgs(array(__DIR__.'/../../Fixtures/foo', 'foo'))
5252
->getMock();
5353
}
5454
}

‎src/Symfony/Component/HttpFoundation/Request.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Request.php
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ public static function create($uri, $method = 'GET', $parameters = array(), $coo
358358
if (!isset($server['CONTENT_TYPE'])) {
359359
$server['CONTENT_TYPE'] = 'application/x-www-form-urlencoded';
360360
}
361+
// no break
361362
case 'PATCH':
362363
$request = $parameters;
363364
$query = array();
@@ -955,7 +956,13 @@ public function getPort()
955956
}
956957

957958
if ($host = $this->headers->get('HOST')) {
958-
if (false !== $pos = strrpos($host, ':')) {
959+
if ($host[0] === '[') {
960+
$pos = strpos($host, ':', strrpos($host, ']'));
961+
} else {
962+
$pos = strrpos($host, ':');
963+
}
964+
965+
if (false !== $pos) {
959966
return intval(substr($host, $pos + 1));
960967
}
961968

‎src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,16 +180,16 @@ public function testXAccelMapping($realpath, $mapping, $virtual)
180180
$request->headers->set('X-Accel-Mapping', $mapping);
181181

182182
$file = $this->getMockBuilder('Symfony\Component\HttpFoundation\File\File')
183-
->disableOriginalConstructor()
184-
->getMock();
183+
->setConstructorArgs(array(__DIR__.'/File/Fixtures/test'))
184+
->getMock();
185185
$file->expects($this->any())
186186
->method('getRealPath')
187187
->will($this->returnValue($realpath));
188188
$file->expects($this->any())
189189
->method('isReadable')
190190
->will($this->returnValue(true));
191-
$file->expects($this->any())
192-
->method('getMTime')
191+
$file->expects($this->any())
192+
->method('getMTime')
193193
->will($this->returnValue(time()));
194194

195195
BinaryFileResponse::trustXSendFileTypeHeader();

‎src/Symfony/Component/HttpFoundation/Tests/RequestTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,14 @@ public function testCreate()
163163
$this->assertEquals(90, $request->getPort());
164164
$this->assertTrue($request->isSecure());
165165

166+
$request = Request::create('https://[::1]/foo');
167+
$this->assertEquals('https://[::1]/foo', $request->getUri());
168+
$this->assertEquals('/foo', $request->getPathInfo());
169+
$this->assertEquals('[::1]', $request->getHost());
170+
$this->assertEquals('[::1]', $request->getHttpHost());
171+
$this->assertEquals(443, $request->getPort());
172+
$this->assertTrue($request->isSecure());
173+
166174
$json = '{"jsonrpc":"2.0","method":"echo","id":7,"params":["Hello World"]}';
167175
$request = Request::create('http://example.com/jsonrpc', 'POST', array(), array(), array(), array(), $json);
168176
$this->assertEquals($json, $request->getContent());

‎src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
+19-13Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ protected function setUp()
3434
$mongoClass = version_compare(phpversion('mongo'), '1.3.0', '<') ? 'Mongo' : 'MongoClient';
3535

3636
$this->mongo = $this->getMockBuilder($mongoClass)
37-
->disableOriginalConstructor()
3837
->getMock();
3938

4039
$this->options = array(
@@ -76,9 +75,7 @@ public function testCloseMethodAlwaysReturnTrue()
7675

7776
public function testWrite()
7877
{
79-
$collection = $this->getMockBuilder('MongoCollection')
80-
->disableOriginalConstructor()
81-
->getMock();
78+
$collection = $this->createMongoCollectionMock();
8279

8380
$this->mongo->expects($this->once())
8481
->method('selectCollection')
@@ -105,9 +102,7 @@ public function testWrite()
105102

106103
public function testReplaceSessionData()
107104
{
108-
$collection = $this->getMockBuilder('MongoCollection')
109-
->disableOriginalConstructor()
110-
->getMock();
105+
$collection = $this->createMongoCollectionMock();
111106

112107
$this->mongo->expects($this->once())
113108
->method('selectCollection')
@@ -130,9 +125,7 @@ public function testReplaceSessionData()
130125

131126
public function testDestroy()
132127
{
133-
$collection = $this->getMockBuilder('MongoCollection')
134-
->disableOriginalConstructor()
135-
->getMock();
128+
$collection = $this->createMongoCollectionMock();
136129

137130
$this->mongo->expects($this->once())
138131
->method('selectCollection')
@@ -148,9 +141,7 @@ public function testDestroy()
148141

149142
public function testGc()
150143
{
151-
$collection = $this->getMockBuilder('MongoCollection')
152-
->disableOriginalConstructor()
153-
->getMock();
144+
$collection = $this->createMongoCollectionMock();
154145

155146
$this->mongo->expects($this->once())
156147
->method('selectCollection')
@@ -178,4 +169,19 @@ public function testGetConnection()
178169

179170
$this->assertInstanceOf($mongoClass, $method->invoke($this->storage));
180171
}
172+
173+
private function createMongoCollectionMock()
174+
{
175+
176+
$mongoClient = $this->getMockBuilder('MongoClient')
177+
->getMock();
178+
$mongoDb = $this->getMockBuilder('MongoDB')
179+
->setConstructorArgs(array($mongoClient, 'database-name'))
180+
->getMock();
181+
$collection = $this->getMockBuilder('MongoCollection')
182+
->setConstructorArgs(array($mongoDb, 'collection-name'))
183+
->getMock();
184+
185+
return $collection;
186+
}
181187
}

‎src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function testValidMimeType()
199199
{
200200
$file = $this
201201
->getMockBuilder('Symfony\Component\HttpFoundation\File\File')
202-
->disableOriginalConstructor()
202+
->setConstructorArgs(array(__DIR__.'/Fixtures/foo'))
203203
->getMock()
204204
;
205205
$file
@@ -227,7 +227,7 @@ public function testValidWildcardMimeType()
227227
{
228228
$file = $this
229229
->getMockBuilder('Symfony\Component\HttpFoundation\File\File')
230-
->disableOriginalConstructor()
230+
->setConstructorArgs(array(__DIR__.'/Fixtures/foo'))
231231
->getMock()
232232
;
233233
$file
@@ -255,7 +255,7 @@ public function testInvalidMimeType()
255255
{
256256
$file = $this
257257
->getMockBuilder('Symfony\Component\HttpFoundation\File\File')
258-
->disableOriginalConstructor()
258+
->setConstructorArgs(array(__DIR__.'/Fixtures/foo'))
259259
->getMock()
260260
;
261261
$file
@@ -289,7 +289,7 @@ public function testInvalidWildcardMimeType()
289289
{
290290
$file = $this
291291
->getMockBuilder('Symfony\Component\HttpFoundation\File\File')
292-
->disableOriginalConstructor()
292+
->setConstructorArgs(array(__DIR__.'/Fixtures/foo'))
293293
->getMock()
294294
;
295295
$file

‎src/Symfony/Component/Validator/Tests/Constraints/Fixtures/foo

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Tests/Constraints/Fixtures/foo
Whitespace-only changes.

0 commit comments

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