php-ipc/tests/Lock/FileLockTest.php

18 lines
359 B
PHP

<?php
namespace NoccyLabs\Ipc\Lock;
class FileLockTest extends \PhpUnit\Framework\TestCase
{
public function testTheLockingShouldBeExclusive()
{
$lock1 = new FileLock(__FILE__);
$lock2 = new FileLock(__FILE__);
$this->assertEquals(true, $lock1->acquire(0));
$this->assertEquals(false, $lock2->acquire(0));
}
}