From 51c0bf0d0d7fdb7a03635bf9dfa8a45c21f60d16 Mon Sep 17 00:00:00 2001 From: Mohammad Emran Hasan Date: Mon, 13 Jul 2020 12:07:04 +0600 Subject: [PATCH] [PhpUnitBridge] Polyfill new phpunit 9.1 assertions --- src/Symfony/Bridge/PhpUnit/CHANGELOG.md | 7 +- .../PhpUnit/Legacy/PolyfillAssertTrait.php | 112 ++++++++++++++++++ 2 files changed, 118 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/PhpUnit/CHANGELOG.md b/src/Symfony/Bridge/PhpUnit/CHANGELOG.md index 6da53d30a017e..c343171feb6a0 100644 --- a/src/Symfony/Bridge/PhpUnit/CHANGELOG.md +++ b/src/Symfony/Bridge/PhpUnit/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +5.2.0 +----- + + * polyfill new phpunit 9.1 assertions + 5.1.0 ----- @@ -25,7 +30,7 @@ CHANGELOG ----- * added `ClassExistsMock` - * bumped PHP version from 5.3.3 to 5.5.9 + * bumped PHP version from 5.3.3 to 5.5.9 * split simple-phpunit bin into php file with code and a shell script 4.1.0 diff --git a/src/Symfony/Bridge/PhpUnit/Legacy/PolyfillAssertTrait.php b/src/Symfony/Bridge/PhpUnit/Legacy/PolyfillAssertTrait.php index 69a01d292704e..1ea47ddfcb81c 100644 --- a/src/Symfony/Bridge/PhpUnit/Legacy/PolyfillAssertTrait.php +++ b/src/Symfony/Bridge/PhpUnit/Legacy/PolyfillAssertTrait.php @@ -276,6 +276,17 @@ public static function assertNotIsReadable($filename, $message = '') static::assertFalse(is_readable($filename), $message ? $message : "Failed asserting that $filename is not readable."); } + /** + * @param string $filename + * @param string $message + * + * @return void + */ + public static function assertIsNotReadable($filename, $message = '') + { + static::assertNotIsReadable($filename, $message); + } + /** * @param string $filename * @param string $message @@ -300,6 +311,17 @@ public static function assertNotIsWritable($filename, $message = '') static::assertFalse(is_writable($filename), $message ? $message : "Failed asserting that $filename is not writable."); } + /** + * @param string $filename + * @param string $message + * + * @return void + */ + public static function assertIsNotWritable($filename, $message = '') + { + static::assertNotIsWritable($filename, $message); + } + /** * @param string $directory * @param string $message @@ -324,6 +346,17 @@ public static function assertDirectoryNotExists($directory, $message = '') static::assertFalse(is_dir($directory), $message ? $message : "Failed asserting that $directory does not exist."); } + /** + * @param string $directory + * @param string $message + * + * @return void + */ + public static function assertDirectoryDoesNotExist($directory, $message = '') + { + static::assertDirectoryNotExists($directory, $message); + } + /** * @param string $directory * @param string $message @@ -348,6 +381,17 @@ public static function assertDirectoryNotIsReadable($directory, $message = '') static::assertNotIsReadable($directory, $message); } + /** + * @param string $directory + * @param string $message + * + * @return void + */ + public static function assertDirectoryIsNotReadable($directory, $message = '') + { + static::assertDirectoryNotIsReadable($directory, $message); + } + /** * @param string $directory * @param string $message @@ -372,6 +416,17 @@ public static function assertDirectoryNotIsWritable($directory, $message = '') static::assertNotIsWritable($directory, $message); } + /** + * @param string $directory + * @param string $message + * + * @return void + */ + public static function assertDirectoryIsNotWritable($directory, $message = '') + { + static::assertDirectoryNotIsWritable($directory, $message); + } + /** * @param string $filename * @param string $message @@ -396,6 +451,17 @@ public static function assertFileNotExists($filename, $message = '') static::assertFalse(file_exists($filename), $message ? $message : "Failed asserting that $filename does not exist."); } + /** + * @param string $filename + * @param string $message + * + * @return void + */ + public static function assertFileDoesNotExist($filename, $message = '') + { + static::assertFileNotExists($filename, $message); + } + /** * @param string $filename * @param string $message @@ -420,6 +486,17 @@ public static function assertFileNotIsReadable($filename, $message = '') static::assertNotIsReadable($filename, $message); } + /** + * @param string $filename + * @param string $message + * + * @return void + */ + public static function assertFileIsNotReadable($filename, $message = '') + { + static::assertFileNotIsReadable($filename, $message); + } + /** * @param string $filename * @param string $message @@ -443,4 +520,39 @@ public static function assertFileNotIsWritable($filename, $message = '') static::assertFileExists($filename, $message); static::assertNotIsWritable($filename, $message); } + + /** + * @param string $filename + * @param string $message + * + * @return void + */ + public static function assertFileIsNotWritable($filename, $message = '') + { + static::assertFileNotIsWritable($filename, $message); + } + + /** + * @param string $pattern + * @param string $string + * @param string $message + * + * @return void + */ + public static function assertMatchesRegularExpression($pattern, $string, $message = '') + { + static::assertRegExp($pattern, $string, $message); + } + + /** + * @param string $pattern + * @param string $string + * @param string $message + * + * @return void + */ + public static function assertDoesNotMatchRegularExpression($pattern, $string, $message = '') + { + static::assertNotRegExp($message, $string, $message); + } } 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