Skip to content

Commit

Permalink
Modernized deprecated PHPUnit assertion calls
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored and fabpot committed Aug 9, 2020
1 parent 5219dba commit 91bdbf8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Tests/BinaryFileResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public function testDeleteFileAfterSend()
$response->prepare($request);
$response->sendContent();

$this->assertFileNotExists($path);
$this->assertFileDoesNotExist($path);
}

public function testAcceptRangeOnUnsafeMethods()
Expand Down
8 changes: 4 additions & 4 deletions Tests/File/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Tests/File/UploadedFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Tests/RedirectResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function testGenerateMetaRedirect()
{
$response = new RedirectResponse('foo.bar');

$this->assertRegExp('#<meta http-equiv="refresh" content="\d+;url=\'foo\.bar\'" />#', preg_replace('/\s+/', ' ', $response->getContent()));
$this->assertMatchesRegularExpression('#<meta http-equiv="refresh" content="\d+;url=\'foo\.bar\'" />#', preg_replace('/\s+/', ' ', $response->getContent()));
}
public function testRedirectResponseConstructorNullUrl()
Expand Down
2 changes: 1 addition & 1 deletion Tests/ResponseHeaderBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

0 comments on commit 91bdbf8

Please sign in to comment.