Remove real call to ifconfig on unit test

This commit is contained in:
Marcos
2016-06-23 21:37:29 +02:00
parent b4fe3b7387
commit dce9d0cb7d
@@ -14,7 +14,18 @@ class SystemNodeProviderTest extends TestCase
*/
public function testGetNodeReturnsSystemNodeFromMacAddress()
{
$provider = new SystemNodeProvider();
$provider = $this->getMockBuilder('Ramsey\Uuid\Provider\Node\SystemNodeProvider')
->setMethods(['getIfconfig'])
->getMock();
$provider->method('getIfconfig')
->willReturn(<<<TXT
vboxnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
ether 0a:00:27:00:00:00
inet 192.168.60.1 netmask 0xffffff00 broadcast 192.168.60.255
TXT
);
$node = $provider->getNode();
$this->assertTrue(ctype_xdigit($node), 'Node should be a hexadecimal string. Actual node: ' . $node);
@@ -52,7 +63,7 @@ class SystemNodeProviderTest extends TestCase
$this->assertEquals($expected, $node);
}
/**
/**\
* @runInSeparateProcess
* @preserveGlobalState disabled
*/