From 29d80b0b6432055a8ffa993478adcfb138a9a302 Mon Sep 17 00:00:00 2001 From: sikofitt Date: Wed, 20 Jan 2021 14:36:38 -0800 Subject: [PATCH 1/3] Update dependencies --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index de5dd9e..38504ee 100644 --- a/composer.json +++ b/composer.json @@ -3,9 +3,10 @@ "description": "Generates dummy mac addresses", "type": "library", "require": { - "php": "^7.2", - "ext-sodium": "*", - "ext-json": "*" + "php": ">=7.3", + "ext-json": "*", + "ext-sodium": "*", + "phpunit/phpunit": "^9.5" }, "autoload": { "psr-4": { @@ -14,7 +15,6 @@ }, "require-dev": { "symfony/console": "^4.1", - "phpunit/phpunit": "^7.4", "friendsofphp/php-cs-fixer": "^2.13", "squizlabs/php_codesniffer": "^3.3" }, From 36d206bed80f3b0f74ec891a4268095ab2248ab1 Mon Sep 17 00:00:00 2001 From: sikofitt Date: Wed, 20 Jan 2021 14:40:21 -0800 Subject: [PATCH 2/3] migrate phpunit config --- phpunit.xml.dist | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3db463a..799c7a6 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,24 +1,17 @@ - - - - - - - - tests/ - - - - - - ./src/ - - + + + + ./src/ + + + + + + + + tests/ + + From 84cb88211561cea2f40457275bc9e121f9648190 Mon Sep 17 00:00:00 2001 From: sikofitt Date: Wed, 20 Jan 2021 14:44:22 -0800 Subject: [PATCH 3/3] PHPUnit 9.x fix --- tests/GenerateMacCommandTest.php | 4 ++-- tests/MacTest.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/GenerateMacCommandTest.php b/tests/GenerateMacCommandTest.php index 2655fb5..c61e43a 100644 --- a/tests/GenerateMacCommandTest.php +++ b/tests/GenerateMacCommandTest.php @@ -49,7 +49,7 @@ class GenerateMacCommandTest extends TestCase { $this->commandTester->execute([]); $display = $this->commandTester->getDisplay(); - $this->assertContains('// Generated 1 mac addresses', $display); + $this->assertStringContainsString('// Generated 1 mac addresses', $display); $this->assertSame(0, $this->commandTester->getStatusCode()); $this->expectException(\RuntimeException::class); $this->commandTester->execute(['--count' => -1]); @@ -65,7 +65,7 @@ class GenerateMacCommandTest extends TestCase public function testPlain(): void { $this->commandTester->execute(['--output' => 'plain', '--count' => 1]); - $this->assertRegExp(self::REGEX, $this->commandTester->getDisplay()); + $this->assertMatchesRegularExpression(self::REGEX, $this->commandTester->getDisplay()); $this->assertSame(0, $this->commandTester->getStatusCode()); } diff --git a/tests/MacTest.php b/tests/MacTest.php index da99e7b..a91abc3 100644 --- a/tests/MacTest.php +++ b/tests/MacTest.php @@ -36,10 +36,10 @@ class MacTest extends TestCase $this->assertCount(50, $macAddresses); foreach ($macAddresses as $address) { - $this->assertRegExp(self::REGEX, $address); + $this->assertMatchesRegularExpression(self::REGEX, $address); } - $this->assertRegExp(self::REGEX, $mac->getMacAddress()); + $this->assertMatchesRegularExpression(self::REGEX, $mac->getMacAddress()); $this->assertSame(Mac::SEPARATOR_COLON, $mac->getSeparator()); $this->assertTrue($mac->getUnique()); } @@ -49,10 +49,10 @@ class MacTest extends TestCase $mac = new Mac(Mac::SEPARATOR_DASH); $this->assertSame(Mac::SEPARATOR_DASH, $mac->getSeparator()); - $this->assertRegExp(self::REGEX, $mac->getMacAddress()); + $this->assertMatchesRegularExpression(self::REGEX, $mac->getMacAddress()); $mac->setSeparator(Mac::SEPARATOR_COLON); $this->assertSame(Mac::SEPARATOR_COLON, $mac->getSeparator()); - $this->assertRegExp(self::REGEX, $mac->getMacAddress()); + $this->assertMatchesRegularExpression(self::REGEX, $mac->getMacAddress()); $this->assertNotFalse(strpos($mac->getMacAddress(), ':')); }