Merge pull request #1 from sikofitt/update-phptests-to-phpunit-9
PHPUnit 9.x fix
This commit is contained in:
commit
cdb67e2f79
|
@ -49,7 +49,7 @@ class GenerateMacCommandTest extends TestCase
|
||||||
{
|
{
|
||||||
$this->commandTester->execute([]);
|
$this->commandTester->execute([]);
|
||||||
$display = $this->commandTester->getDisplay();
|
$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->assertSame(0, $this->commandTester->getStatusCode());
|
||||||
$this->expectException(\RuntimeException::class);
|
$this->expectException(\RuntimeException::class);
|
||||||
$this->commandTester->execute(['--count' => -1]);
|
$this->commandTester->execute(['--count' => -1]);
|
||||||
|
@ -65,7 +65,7 @@ class GenerateMacCommandTest extends TestCase
|
||||||
public function testPlain(): void
|
public function testPlain(): void
|
||||||
{
|
{
|
||||||
$this->commandTester->execute(['--output' => 'plain', '--count' => 1]);
|
$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());
|
$this->assertSame(0, $this->commandTester->getStatusCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,10 +36,10 @@ class MacTest extends TestCase
|
||||||
$this->assertCount(50, $macAddresses);
|
$this->assertCount(50, $macAddresses);
|
||||||
|
|
||||||
foreach ($macAddresses as $address) {
|
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->assertSame(Mac::SEPARATOR_COLON, $mac->getSeparator());
|
||||||
$this->assertTrue($mac->getUnique());
|
$this->assertTrue($mac->getUnique());
|
||||||
}
|
}
|
||||||
|
@ -49,10 +49,10 @@ class MacTest extends TestCase
|
||||||
$mac = new Mac(Mac::SEPARATOR_DASH);
|
$mac = new Mac(Mac::SEPARATOR_DASH);
|
||||||
|
|
||||||
$this->assertSame(Mac::SEPARATOR_DASH, $mac->getSeparator());
|
$this->assertSame(Mac::SEPARATOR_DASH, $mac->getSeparator());
|
||||||
$this->assertRegExp(self::REGEX, $mac->getMacAddress());
|
$this->assertMatchesRegularExpression(self::REGEX, $mac->getMacAddress());
|
||||||
$mac->setSeparator(Mac::SEPARATOR_COLON);
|
$mac->setSeparator(Mac::SEPARATOR_COLON);
|
||||||
$this->assertSame(Mac::SEPARATOR_COLON, $mac->getSeparator());
|
$this->assertSame(Mac::SEPARATOR_COLON, $mac->getSeparator());
|
||||||
$this->assertRegExp(self::REGEX, $mac->getMacAddress());
|
$this->assertMatchesRegularExpression(self::REGEX, $mac->getMacAddress());
|
||||||
$this->assertNotFalse(strpos($mac->getMacAddress(), ':'));
|
$this->assertNotFalse(strpos($mac->getMacAddress(), ':'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue