* * 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:----gKIG1BDJnB3WnAnGBk6+Ae6KQvCOCRa7eT0bKm6AlCl1HvTXicvYQsFuqfXHQ0DpAIF52nYmaMYvePdKuHsjMjM2vTztK9vNDbutxkzApvcXUY/7BL6yGCTJRrADIAYWqlhdJkCKznWJxD2KX6uR8N3GWejZb2e5FnZgyjUhVydFLEb2CsL+BYiiMhSnJsUA9hWueYrYCq8TztOI9l9THo8d4fFCxBz8eoVoIsRBL5OXsgzjziJC/FYpQq9sFxtQqPyYS2SuoSkVHwDJAlGEdvuIE9XC2P36KHwSvfHxjl64jQyVGZ5g2LEiBi3aaRN7S+ss2l75rkehpa9Rqc+tIcSwe/lyiE3DuGl5/B2arWq48mxq6HQs5Oobaj3goAlOAIRR77HGZbolLGwOChDrwCetl4IIRMYQnPi5VqzREfiotjimddCiBpf2HDm1E8sG3WlR0stJ2Jm2LiAhMbEchAxmNRRuZ/gk4s1+4vWsMXbcjf7krI7ETZclKH7sUZSicWIvIERB/lCHjvfP3CZk50OaQ2ReIH/XUPRGyHhWgDRyAaHVhGtThH0S2rpAK7eawmbsjXEf+JLynKoS4RXqGLVfKxqBSFP9xEu+G4gyvk4oBTADq48gNssxwpP+JAvwnZ//HIFP8jfolAcYqioGNKtLObhaFaLBWG5VufUi/SU=----ATTACHMENT:----MTEwMTg4OTAyNzY2NTg2MSA1NjQ4MzMxNzgzMTczNzAgMjgwOTY0NjY4NTE1MzUyNA==