Version 1
[yaffs-website] / vendor / symfony / http-kernel / Tests / Profiler / SqliteProfilerStorageTest.php
diff --git a/vendor/symfony/http-kernel/Tests/Profiler/SqliteProfilerStorageTest.php b/vendor/symfony/http-kernel/Tests/Profiler/SqliteProfilerStorageTest.php
new file mode 100644 (file)
index 0000000..55994f7
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpKernel\Tests\Profiler;
+
+use Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage;
+
+/**
+ * @group legacy
+ * @requires extension pdo_sqlite
+ */
+class SqliteProfilerStorageTest extends AbstractProfilerStorageTest
+{
+    private $dbFile;
+    private $storage;
+
+    protected function setUp()
+    {
+        $this->dbFile = tempnam(sys_get_temp_dir(), 'sf2_sqlite_storage');
+        if (file_exists($this->dbFile)) {
+            @unlink($this->dbFile);
+        }
+        $this->storage = new SqliteProfilerStorage('sqlite:'.$this->dbFile);
+
+        $this->storage->purge();
+    }
+
+    protected function tearDown()
+    {
+        @unlink($this->dbFile);
+    }
+
+    /**
+     * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
+     */
+    protected function getStorage()
+    {
+        return $this->storage;
+    }
+}