commit
db95499a7b
|
@ -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"
|
||||
},
|
||||
|
|
|
@ -1,24 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/7.4/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="true"
|
||||
bootstrap="vendor/autoload.php"
|
||||
>
|
||||
<php>
|
||||
<ini name="error_reporting" value="-1" />
|
||||
</php>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="Project Test Suite">
|
||||
<directory>tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./src/</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php">
|
||||
<coverage>
|
||||
<include>
|
||||
<directory>./src/</directory>
|
||||
</include>
|
||||
</coverage>
|
||||
<php>
|
||||
<ini name="error_reporting" value="-1"/>
|
||||
</php>
|
||||
<testsuites>
|
||||
<testsuite name="Project Test Suite">
|
||||
<directory>tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
</phpunit>
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
@ -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(), ':'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue