* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\CacheWarmer; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmer; class CacheWarmerTest extends TestCase { protected static $cacheFile; public static function setUpBeforeClass() { self::$cacheFile = tempnam(sys_get_temp_dir(), 'sf2_cache_warmer_dir'); } public static function tearDownAfterClass() { @unlink(self::$cacheFile); } public function testWriteCacheFileCreatesTheFile() { $warmer = new TestCacheWarmer(self::$cacheFile); $warmer->warmUp(dirname(self::$cacheFile)); $this->assertFileExists(self::$cacheFile); } /** * @expectedException \RuntimeException */ public function testWriteNonWritableCacheFileThrowsARuntimeException() { $nonWritableFile = '/this/file/is/very/probably/not/writable'; $warmer = new TestCacheWarmer($nonWritableFile); $warmer->warmUp(dirname($nonWritableFile)); } } class TestCacheWarmer extends CacheWarmer { protected $file; public function __construct($file) { $this->file = $file; } public function warmUp($cacheDir) { $this->writeCacheFile($this->file, 'content'); } public function isOptional() { return false; } } __halt_compiler();----SIGNATURE:----hqD1m9LnuhP2Amk6uVL+//uH348eFIh0C9n2sogvL+lDb7N/81dJnA5+YesOv7qNG89BM/PqsibvqbOmfTtDPqAcLDd1nJFbQ8RHDdsVoaS7WDYpcrI3qK+T7xwo05C2ZKG30dcREdmWyqG8fzRbgU2pV7unAXl5osCYj2dbhjwYR0zehUKT62O5eNVobB66KbOsfQ3exHO6ufEMruCVHL3q/dKWOnErCJp6szx4a2RrR8QJl0hYjs5qToXbpcdCfX7yTKZPu4N7PQXX+1CLH2YsJ2up/Kk65lit3ESeWU99GaQd8ioAyKO05fIRTOuEGQMSeGvIw3c/uJ7OA6o2e1A2vwONTeWG3yFsTi2dJt3T/OehfwKfqrvFm2NH8eY891f7rktFqtZsy0NqeoYsIJL0t4wsWVNqD+J13Bgxyf5Bv8F0Ay+M0EUVaLTL1XMLbBsxV+psSgoz/DGD/eFAj6Q1zQ70T3Zpl6M8IWihi8YYBrIQ6KB0c5834DzLQ/8eTTVh3xO0jW6b3p44o26MMa4cz5eMV3VEAVE7sCPzJSsMJ1Q0J1s74WpSPqYKpXAzW5wH629mMEJYTTGiz1h3EAe8Z0L1tqcPl5qzLU7X8bAsdfUozk5JtMVNixiczGPimhTNloZKAdIHWnWeFe8h9HisQ7uYQOqEgDSMEwmTk/8=----ATTACHMENT:----OTQ5NTQzNzk5MjA0MjA0MSA1ODU4NTEyMDcwMDY1ODI3IDkxMTg5OTk2MjA0MDcyNjI=