Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / common / tests / Doctrine / Tests / Common / Annotations / FileCacheReaderTest.php
1 <?php
2
3 namespace Doctrine\Tests\Common\Annotations;
4
5 use Doctrine\Common\Annotations\AnnotationReader;
6 use Doctrine\Common\Annotations\FileCacheReader;
7
8 class FileCacheReaderTest extends AbstractReaderTest
9 {
10     private $cacheDir;
11
12     protected function getReader()
13     {
14         $this->cacheDir = sys_get_temp_dir() . "/annotations_". uniqid();
15         @mkdir($this->cacheDir);
16         return new FileCacheReader(new AnnotationReader(), $this->cacheDir);
17     }
18
19     public function tearDown()
20     {
21         foreach (glob($this->cacheDir.'/*.php') AS $file) {
22             unlink($file);
23         }
24         rmdir($this->cacheDir);
25     }
26
27     /**
28      * @group DCOM-81
29      */
30     public function testAttemptToCreateAnnotationCacheDir()
31     {
32         $this->cacheDir = sys_get_temp_dir() . "/not_existed_dir_". uniqid();
33
34         $this->assertFalse(is_dir($this->cacheDir));
35
36         $cache = new FileCacheReader(new AnnotationReader(), $this->cacheDir);
37
38         $this->assertTrue(is_dir($this->cacheDir));
39     }
40 }