Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use symfony/phpunit-bridge #163

Merged
merged 2 commits into from
Dec 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,7 @@ jobs:

- name: Run tests with PHPUnit
run: |
vendor/bin/phpunit
echo ::group::Install
./vendor/bin/simple-phpunit install
echo ::endgroup::
./vendor/bin/simple-phpunit
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"require-dev": {
"ext-intl": "*",
"bamarni/composer-bin-plugin": "^1.4.1",
"phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.4.2"
"symfony/phpunit-bridge": "^4.4 || ^5.2"
},
"autoload": {
"psr-4": {
Expand Down
30 changes: 0 additions & 30 deletions test/Faker/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
namespace Faker\Test;

use Faker\Generator;
use PHPUnit\Framework\Constraint\LogicalNot;
use PHPUnit\Framework\Constraint\RegularExpression;
use PHPUnit\Framework\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
Expand All @@ -24,34 +22,6 @@ protected function setUp(): void
}
}

/**
* Asserts that a string matches a given regular expression.
*
* @throws \PHPUnit\Framework\ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*/
public static function assertMatchesRegularExpression(string $pattern, string $string, string $message = ''): void
{
self::assertThat($string, new RegularExpression($pattern), $message);
}

/**
* Asserts that a string does not match a given regular expression.
*
* @throws \PHPUnit\Framework\ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*/
public static function assertDoesNotMatchRegularExpression(string $pattern, string $string, string $message = ''): void
{
self::assertThat(
$string,
new LogicalNot(
new RegularExpression($pattern)
),
$message
);
}

public static function localeDataProvider(): array
{
$locales = [];
Expand Down