php-ipc/tests/Lock/FileLockTest.php

18 lines
359 B
PHP
Raw Permalink Normal View History

2018-04-15 14:41:46 +00:00
<?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));
}
}