From 91bdbf8c8824aa5a5fa44f79c05371c9bb524aae Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sat, 8 Aug 2020 16:41:28 +0200 Subject: [PATCH 1/2] Modernized deprecated PHPUnit assertion calls --- Tests/BinaryFileResponseTest.php | 2 +- Tests/File/FileTest.php | 8 ++++---- Tests/File/UploadedFileTest.php | 2 +- Tests/RedirectResponseTest.php | 2 +- Tests/ResponseHeaderBagTest.php | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Tests/BinaryFileResponseTest.php b/Tests/BinaryFileResponseTest.php index fcad11def..31916fc7d 100644 --- a/Tests/BinaryFileResponseTest.php +++ b/Tests/BinaryFileResponseTest.php @@ -309,7 +309,7 @@ public function testDeleteFileAfterSend() $response->prepare($request); $response->sendContent(); - $this->assertFileNotExists($path); + $this->assertFileDoesNotExist($path); } public function testAcceptRangeOnUnsafeMethods() diff --git a/Tests/File/FileTest.php b/Tests/File/FileTest.php index b463aadf8..06a4ad8b1 100644 --- a/Tests/File/FileTest.php +++ b/Tests/File/FileTest.php @@ -83,7 +83,7 @@ public function testMove() $this->assertInstanceOf('Symfony\Component\HttpFoundation\File\File', $movedFile); $this->assertFileExists($targetPath); - $this->assertFileNotExists($path); + $this->assertFileDoesNotExist($path); $this->assertEquals(realpath($targetPath), $movedFile->getRealPath()); @unlink($targetPath); @@ -102,7 +102,7 @@ public function testMoveWithNewName() $movedFile = $file->move($targetDir, 'test.newname.gif'); $this->assertFileExists($targetPath); - $this->assertFileNotExists($path); + $this->assertFileDoesNotExist($path); $this->assertEquals(realpath($targetPath), $movedFile->getRealPath()); @unlink($targetPath); @@ -137,7 +137,7 @@ public function testMoveWithNonLatinName($filename, $sanitizedFilename) $this->assertInstanceOf('Symfony\Component\HttpFoundation\File\File', $movedFile); $this->assertFileExists($targetPath); - $this->assertFileNotExists($path); + $this->assertFileDoesNotExist($path); $this->assertEquals(realpath($targetPath), $movedFile->getRealPath()); @unlink($targetPath); @@ -157,7 +157,7 @@ public function testMoveToAnUnexistentDirectory() $movedFile = $file->move($targetDir); $this->assertFileExists($targetPath); - $this->assertFileNotExists($sourcePath); + $this->assertFileDoesNotExist($sourcePath); $this->assertEquals(realpath($targetPath), $movedFile->getRealPath()); @unlink($sourcePath); diff --git a/Tests/File/UploadedFileTest.php b/Tests/File/UploadedFileTest.php index 2ea924bac..4a8d2bb14 100644 --- a/Tests/File/UploadedFileTest.php +++ b/Tests/File/UploadedFileTest.php @@ -177,7 +177,7 @@ public function testMoveLocalFileIsAllowedInTestMode() $movedFile = $file->move(__DIR__.'/Fixtures/directory'); $this->assertFileExists($targetPath); - $this->assertFileNotExists($path); + $this->assertFileDoesNotExist($path); $this->assertEquals(realpath($targetPath), $movedFile->getRealPath()); @unlink($targetPath); diff --git a/Tests/RedirectResponseTest.php b/Tests/RedirectResponseTest.php index 2bbf5aa1a..47e5f8c64 100644 --- a/Tests/RedirectResponseTest.php +++ b/Tests/RedirectResponseTest.php @@ -20,7 +20,7 @@ public function testGenerateMetaRedirect() { $response = new RedirectResponse('foo.bar'); - $this->assertRegExp('##', preg_replace('/\s+/', ' ', $response->getContent())); + $this->assertMatchesRegularExpression('##', preg_replace('/\s+/', ' ', $response->getContent())); } public function testRedirectResponseConstructorNullUrl() diff --git a/Tests/ResponseHeaderBagTest.php b/Tests/ResponseHeaderBagTest.php index 632c96df5..028593a12 100644 --- a/Tests/ResponseHeaderBagTest.php +++ b/Tests/ResponseHeaderBagTest.php @@ -362,6 +362,6 @@ public function testDateHeaderWillBeRecreatedWhenHeadersAreReplaced() private function assertSetCookieHeader($expected, ResponseHeaderBag $actual) { - $this->assertRegExp('#^Set-Cookie:\s+'.preg_quote($expected, '#').'$#m', str_replace("\r\n", "\n", (string) $actual)); + $this->assertMatchesRegularExpression('#^Set-Cookie:\s+'.preg_quote($expected, '#').'$#m', str_replace("\r\n", "\n", (string) $actual)); } } From e3e5a62a6631a461954d471e7206e3750dbe8ee1 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 17 Aug 2020 09:39:58 +0200 Subject: [PATCH 2/2] Fix CS --- Request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Request.php b/Request.php index 33f4efb5e..9f51e3b93 100644 --- a/Request.php +++ b/Request.php @@ -1589,7 +1589,7 @@ public function isNoCache() /** * Gets the preferred format for the response by inspecting, in the following order: * * the request format set using setRequestFormat - * * the values of the Accept HTTP header + * * the values of the Accept HTTP header. * * Note that if you use this method, you should send the "Vary: Accept" header * in the response to prevent any issues with intermediary HTTP caches. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy