Cover that SystemNodeProvider::getNode returns false when it doesn't find node

This commit is contained in:
Marcos
2016-06-23 21:02:39 +02:00
parent 5dbd993b4b
commit 6cb7128cbe
@@ -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')