mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-14 15:56:48 +03:00
mock glob function to get assertions work
This commit is contained in:
@@ -217,6 +217,10 @@ class SystemNodeProviderTest extends TestCase
|
||||
public function testCallGetsysfsOnLinux($os)
|
||||
{
|
||||
AspectMock::func('Ramsey\Uuid\Provider\Node', 'php_uname', $os);
|
||||
AspectMock::func('Ramsey\Uuid\Provider\Node', 'glob', [
|
||||
'data://text/plain,00:00:00:00:00:00',
|
||||
'data://text/plain,01:02:03:04:05:06',
|
||||
]);
|
||||
|
||||
//Using a mock to verify the provider only gets the node from ifconfig one time
|
||||
$provider = $this->getMockBuilder('Ramsey\Uuid\Provider\Node\SystemNodeProvider')
|
||||
@@ -235,5 +239,6 @@ class SystemNodeProviderTest extends TestCase
|
||||
->willReturn(PHP_EOL . '01-02-03-04-05-06' . PHP_EOL);
|
||||
}
|
||||
$node = $provider->getNode();
|
||||
$this->assertEquals('010203040506', $node);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user