Initial commit
This commit is contained in:
31
tests/Shm/SharedDataTest.php
Normal file
31
tests/Shm/SharedDataTest.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace NoccyLabs\Ipc\Shm;
|
||||
|
||||
use NoccyLabs\Ipc\Key\FileKey;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class SharedDataTest extends \PhpUnit\Framework\TestCase
|
||||
{
|
||||
public function testOpeningSharedData()
|
||||
{
|
||||
$key = new FileKey(__DIR__);
|
||||
$shm = new SharedData($key);
|
||||
|
||||
$this->assertNull($shm->get("foo"));
|
||||
|
||||
$this->assertTrue($shm->set("foo", "hello"));
|
||||
$this->assertEquals("hello", $shm->get("foo"));
|
||||
|
||||
$this->assertNull($shm->get("bar"));
|
||||
|
||||
$this->assertTrue($shm->set("bar", "world"));
|
||||
$this->assertEquals("hello", $shm->get("foo"));
|
||||
$this->assertEquals("world", $shm->get("bar"));
|
||||
|
||||
$shm->destroy();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user