* * 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:----aQYNeZLdkhy3sMl9QGeXjbpcRTMfyRu6OCVIhqWDB/Nl/akaCQBdhRXfXrjJpdoGJ2smkljlxuuAC6IeNxrQtXSeDPZDlDNUZd4r+mXQZoGPdntjhuaCC1a6skoX7VuS4OOW6GwlZGUG2yDE83lCYDS4YXHIeMAWzd4/3e8MSgxGtQyXksz2+R2kgMSnp1J8gtB7JWFjRvDraBLJAb4UHVOp//yfavSImCXjDp/Ab/NZsSkeJu69Dy4eQxqpQN278gZhOZzrQfbVVMKYHAX4SLuTRa2juUpTO+FMr16MY4WQ6WICVCeRQgb95hmcvLFON4kMdguHM0qIi/Sh+dyFnst5tigoOnbuzlr+Sj+qr1S2Wyi9ph1/H+txsBc8vMS+QQHnXjZZQJefEAv3/ik/kfF+tKQczqyrty0LDY7jkPyAoInOuZHR/gHPPl/JgH06EWuid0Kyq0j8eQhE7+ioR4DkzthYsZy2Y0BFLuNlmP/YOKoTu8N8PgdMahjrM+DPTwGDKPP0WAJWLY3Cap/Vcd7pu8VvaMfxhPzgoFWPYVOWx0RsJT1rxYe4fY0jWODX6+oCriWorMYmt8PdZaVBjPpotp5jZRsHa4dZCVXPG50VqeXZl4seB52vZAR5qufAu1TKoEN8o5Koye0RxSm8+NJRqwyc7NNARLytVIgHiV4=----ATTACHMENT:----ODY3NTY2ODE2NTc2MzA4NyA0NjA1NTY1ODQ5NTAyNTA4IDI1Mjc2NTE5NjM5MzA3Mw==