mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-15 16:07:55 +03:00
Cover that SystemNodeProvider::getNode returns false when it doesn't find node
This commit is contained in:
@@ -71,6 +71,20 @@ class SystemNodeProviderTest extends TestCase
|
||||
$this->assertEquals('AABBCCDDEEFF', $node);
|
||||
}
|
||||
|
||||
public function testGetNodeReturnsFalseWhenNodeIsNotFound()
|
||||
{
|
||||
$provider = $this->getMockBuilder('Ramsey\Uuid\Provider\Node\SystemNodeProvider')
|
||||
->setMethods(['getIfconfig'])
|
||||
->getMock();
|
||||
|
||||
$provider->expects($this->once())
|
||||
->method('getIfconfig')
|
||||
->willReturn('some string that does not match the mac address');
|
||||
|
||||
$node = $provider->getNode();
|
||||
$this->assertFalse($node);
|
||||
}
|
||||
|
||||
public function testGetNodeWillNotExecuteSystemCallIfFailedFirstTime()
|
||||
{
|
||||
$provider = $this->getMockBuilder('Ramsey\Uuid\Provider\Node\SystemNodeProvider')
|
||||
|
||||
Reference in New Issue
Block a user