* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Lock\Tests\Store; use Symfony\Component\Lock\Key; use Symfony\Component\Lock\Store\FlockStore; /** * @author Jérémy Derussé */ class FlockStoreTest extends AbstractStoreTest { use BlockingStoreTestTrait; /** * {@inheritdoc} */ protected function getStore() { return new FlockStore(); } /** * @expectedException \Symfony\Component\Lock\Exception\InvalidArgumentException * @expectedExceptionMessage The directory "/a/b/c/d/e" is not writable. */ public function testConstructWhenRepositoryDoesNotExist() { if (!getenv('USER') || 'root' === getenv('USER')) { $this->markTestSkipped('This test will fail if run under superuser'); } new FlockStore('/a/b/c/d/e'); } /** * @expectedException \Symfony\Component\Lock\Exception\InvalidArgumentException * @expectedExceptionMessage The directory "/" is not writable. */ public function testConstructWhenRepositoryIsNotWriteable() { if (!getenv('USER') || 'root' === getenv('USER')) { $this->markTestSkipped('This test will fail if run under superuser'); } new FlockStore('/'); } public function testSaveSanitizeName() { $store = $this->getStore(); $key = new Key(''); $file = sprintf( '%s/sf.-php-echo-hello-word-.%s.lock', sys_get_temp_dir(), strtr(substr(base64_encode(hash('sha256', $key, true)), 0, 7), '/', '_') ); // ensure the file does not exist before the store @unlink($file); $store->save($key); $this->assertFileExists($file); $store->delete($key); } } __halt_compiler();----SIGNATURE:----SRwxIT2xMpYYp3SRCugMNlvcw/7YtX8iY0QF+hWLI92hrsC4SMkb+0Stgpg7vHTybsMzjocOz0286j3FBwJgOL0ZESL/DKQqSa3OqP2dah15qABgxXh3Ml0Dm9VvtEQI8E/zecpX5kLv8XcRIDoMZCNJgmXwwMdugffNuFJY+LC8MeWCS8cnkjWhwgkafP0QIPpIpzk1Uuql7f/ElLzkffc5qsEcA1dzLJQfE4JQ/T7r+l63Go1sauNnusBI0/6wFkwu6Zv2yqJ+YM5IDerBZ5D6gfxDlHT6MTc3xK5W5euKl0hKLjeQN7GCn0vmfY7sCgmoDZ16UwIejRuy0EIYCht8Qjj1IF/2tou56EikLLIRBifv+NOQ3NEJ5+OtLfy4k06l2IJv5L3XOjk03ziTmr3IYLMViON4KajcVGyq0weWR8ZKlvCdi+LrGJGA+qmXGAqbcLS4lEnadMV8EuIUrdJLFdaWo+K2VHIrrvB6izEYBBIxArfPIpvJlzTVpTmTJd1C4qieCpaJaQX+BG6DVhDRipmceLHUuH5wliJs/8pf28RJX3Vezxmb7YhRP/h/z/vc5gmf65INxLugasZ8zSxu7S/RvIuC6GAWe0+XxNXfvc+3lAyz5nFGO7cA6X+VosKv4wn0n6rxYrug/N1BiKjAY19DmWkXzFeHl5QXAJQ=----ATTACHMENT:----MzUyMjI3OTU0NTgzMDE5OSA5MzQ3OTQxNzEyMjczMzA4IDk3NjY0MzA3MTM1NTMzMzY=