Initial commit

This commit is contained in:
2018-04-15 16:41:46 +02:00
commit 86ff40274b
29 changed files with 1368 additions and 0 deletions

View 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();
}
}