File tree Expand file tree Collapse file tree 5 files changed +39
-14
lines changed
tests/ArthurH/SphringCache Expand file tree Collapse file tree 5 files changed +39
-14
lines changed Original file line number Diff line number Diff line change 1818 */
1919class AbstractSphringCache extends \PHPUnit_Framework_TestCase
2020{
21+ public function __construct ()
22+ {
23+ parent ::__construct ();
24+ $ this ->contextFileTest = __DIR__ . '/Resources/mainSimpleTest.yml ' ;
25+ }
26+
27+ protected $ contextFileTest ;
2128 /**
2229 * @var Sphring
2330 */
@@ -42,7 +49,7 @@ class AbstractSphringCache extends \PHPUnit_Framework_TestCase
4249
4350 public function setUp ()
4451 {
45- $ contextFile = new File (__DIR__ . ' /Resources/mainSimpleTest.yml ' );
52+ $ contextFile = new File ($ this -> contextFileTest );
4653 $ this ->contextCacheFile = new File (sys_get_temp_dir () . DIRECTORY_SEPARATOR .
4754 SphringCacheEnum::CACHE_FOLDER . DIRECTORY_SEPARATOR
4855 . sprintf (SphringCacheEnum::CACHE_FILE_CONTEXT , $ contextFile ->getHash ('md5 ' )));
@@ -55,7 +62,7 @@ public function setUp()
5562 $ this ->annotationFolder = new Folder (sys_get_temp_dir () . DIRECTORY_SEPARATOR .
5663 SphringCacheEnum::CACHE_FOLDER . DIRECTORY_SEPARATOR .
5764 SphringCacheEnum::CACHE_FOLDER_ANNOTATIONS );
58- $ this ->sphring = new Sphring (__DIR__ . ' /Resources/mainSimpleTest.yml ' );
65+ $ this ->sphring = new Sphring ($ this -> contextFileTest );
5966 $ this ->sphring ->setComposerLockFile (__DIR__ . '/Resources/composer.lock ' );
6067 $ this ->sphring ->loadContext ();
6168 }
Original file line number Diff line number Diff line change 1818
1919class CacheableTest extends AbstractSphringCache
2020{
21+ public function __construct ()
22+ {
23+ parent ::__construct ();
24+ $ this ->contextFileTest = __DIR__ . '/../Resources/mainCacheTest.yml ' ;
25+ }
2126
2227 public function testSimpleCacheable ()
2328 {
@@ -35,7 +40,10 @@ public function testSimpleCacheable()
3540
3641 public function tearDown ()
3742 {
38- parent ::tearDown ();
43+ $ this ->contextCacheFile ->remove ();
44+ $ this ->annotationFolder ->removeFiles ('#.*#i ' , true );
45+ $ this ->annotationFolder ->removeFolders ('#.*#i ' , true );
46+ $ this ->annotationFolder ->remove ();
3947 $ cacheFolder = new Folder (__DIR__ . '/../cache ' );
4048 $ cacheFolder ->removeFiles ('#.*#i ' , true );
4149 $ cacheFolder ->removeFolders ('#.*#i ' , true );
Original file line number Diff line number Diff line change 1+ cache :
2+ type : cache
3+ class : ArthurH\SphringCache\CacheManager\DoctrineCacheManager
4+ properties :
5+ doctrineCache :
6+ ref : filesystemCache
7+ foobean :
8+ class : ArthurH\SphringCache\FakeBean\Foo
9+ properties :
10+ bar :
11+ ref : barbean
12+ barbean :
13+ class : ArthurH\SphringCache\FakeBean\Bar
14+ filesystemCache :
15+ class : Doctrine\Common\Cache\FilesystemCache
16+ constructor :
17+ 1 :
18+ value : %CONTEXTROOT%/../cache
Original file line number Diff line number Diff line change 11cache :
22 type : cache
3- class : ArthurH\SphringCache\CacheManager\DoctrineCacheManager
3+ class : ArthurH\SphringCache\CacheManager\NullCacheManager
44 cacheSphringBean : true
5- properties :
6- doctrineCache :
7- ref : filesystemCache
85foobean :
96 class : ArthurH\SphringCache\FakeBean\Foo
107 properties :
118 bar :
129 ref : barbean
1310barbean :
1411 class : ArthurH\SphringCache\FakeBean\Bar
15- filesystemCache :
16- class : Doctrine\Common\Cache\FilesystemCache
17- constructor :
18- 1 :
19- value : %CONTEXTROOT%/../cache
Original file line number Diff line number Diff line change @@ -45,13 +45,13 @@ public function testCacheContextFile()
4545 public function testCacheProxies ()
4646 {
4747 $ files = $ this ->proxiesFolder ->getFiles ('#.*.php$#i ' );
48- $ this ->assertCount (4 , $ files );
48+ $ this ->assertCount (5 , $ files );
4949 }
5050
5151 public function testCacheAnnotations ()
5252 {
5353 $ files = $ this ->annotationFolder ->getFiles ('#.*$#i ' , true );
54- $ this ->assertCount (59 , $ files );
54+ $ this ->assertCount (29 , $ files );
5555 }
5656
5757 public function testCacheBean ()
You can’t perform that action at this time.
0 commit comments