@@ -18,7 +18,7 @@ protected function tearDown(): void
1818 public function testIsExpiredReturnsTrueIfCompiledFileDoesntExist ()
1919 {
2020 $ compiler = new BladeCompiler ($ files = $ this ->getFiles (), __DIR__ );
21- $ files ->shouldReceive ('exists ' )->once ()->with (__DIR__ .'/ ' .sha1 ('foo ' ).'.php ' )->andReturn (false );
21+ $ files ->shouldReceive ('exists ' )->once ()->with (__DIR__ .'/ ' .sha1 ('v2foo ' ).'.php ' )->andReturn (false );
2222 $ this ->assertTrue ($ compiler ->isExpired ('foo ' ));
2323 }
2424
@@ -33,31 +33,31 @@ public function testCannotConstructWithBadCachePath()
3333 public function testIsExpiredReturnsTrueWhenModificationTimesWarrant ()
3434 {
3535 $ compiler = new BladeCompiler ($ files = $ this ->getFiles (), __DIR__ );
36- $ files ->shouldReceive ('exists ' )->once ()->with (__DIR__ .'/ ' .sha1 ('foo ' ).'.php ' )->andReturn (true );
36+ $ files ->shouldReceive ('exists ' )->once ()->with (__DIR__ .'/ ' .sha1 ('v2foo ' ).'.php ' )->andReturn (true );
3737 $ files ->shouldReceive ('lastModified ' )->once ()->with ('foo ' )->andReturn (100 );
38- $ files ->shouldReceive ('lastModified ' )->once ()->with (__DIR__ .'/ ' .sha1 ('foo ' ).'.php ' )->andReturn (0 );
38+ $ files ->shouldReceive ('lastModified ' )->once ()->with (__DIR__ .'/ ' .sha1 ('v2foo ' ).'.php ' )->andReturn (0 );
3939 $ this ->assertTrue ($ compiler ->isExpired ('foo ' ));
4040 }
4141
4242 public function testCompilePathIsProperlyCreated ()
4343 {
4444 $ compiler = new BladeCompiler ($ this ->getFiles (), __DIR__ );
45- $ this ->assertEquals (__DIR__ .'/ ' .sha1 ('foo ' ).'.php ' , $ compiler ->getCompiledPath ('foo ' ));
45+ $ this ->assertEquals (__DIR__ .'/ ' .sha1 ('v2foo ' ).'.php ' , $ compiler ->getCompiledPath ('foo ' ));
4646 }
4747
4848 public function testCompileCompilesFileAndReturnsContents ()
4949 {
5050 $ compiler = new BladeCompiler ($ files = $ this ->getFiles (), __DIR__ );
5151 $ files ->shouldReceive ('get ' )->once ()->with ('foo ' )->andReturn ('Hello World ' );
52- $ files ->shouldReceive ('put ' )->once ()->with (__DIR__ .'/ ' .sha1 ('foo ' ).'.php ' , 'Hello World<?php /**PATH foo ENDPATH**/ ?> ' );
52+ $ files ->shouldReceive ('put ' )->once ()->with (__DIR__ .'/ ' .sha1 ('v2foo ' ).'.php ' , 'Hello World<?php /**PATH foo ENDPATH**/ ?> ' );
5353 $ compiler ->compile ('foo ' );
5454 }
5555
5656 public function testCompileCompilesAndGetThePath ()
5757 {
5858 $ compiler = new BladeCompiler ($ files = $ this ->getFiles (), __DIR__ );
5959 $ files ->shouldReceive ('get ' )->once ()->with ('foo ' )->andReturn ('Hello World ' );
60- $ files ->shouldReceive ('put ' )->once ()->with (__DIR__ .'/ ' .sha1 ('foo ' ).'.php ' , 'Hello World<?php /**PATH foo ENDPATH**/ ?> ' );
60+ $ files ->shouldReceive ('put ' )->once ()->with (__DIR__ .'/ ' .sha1 ('v2foo ' ).'.php ' , 'Hello World<?php /**PATH foo ENDPATH**/ ?> ' );
6161 $ compiler ->compile ('foo ' );
6262 $ this ->assertSame ('foo ' , $ compiler ->getPath ());
6363 }
@@ -73,7 +73,7 @@ public function testCompileWithPathSetBefore()
7373 {
7474 $ compiler = new BladeCompiler ($ files = $ this ->getFiles (), __DIR__ );
7575 $ files ->shouldReceive ('get ' )->once ()->with ('foo ' )->andReturn ('Hello World ' );
76- $ files ->shouldReceive ('put ' )->once ()->with (__DIR__ .'/ ' .sha1 ('foo ' ).'.php ' , 'Hello World<?php /**PATH foo ENDPATH**/ ?> ' );
76+ $ files ->shouldReceive ('put ' )->once ()->with (__DIR__ .'/ ' .sha1 ('v2foo ' ).'.php ' , 'Hello World<?php /**PATH foo ENDPATH**/ ?> ' );
7777 // set path before compilation
7878 $ compiler ->setPath ('foo ' );
7979 // trigger compilation with $path
@@ -103,7 +103,7 @@ public function testIncludePathToTemplate($content, $compiled)
103103 {
104104 $ compiler = new BladeCompiler ($ files = $ this ->getFiles (), __DIR__ );
105105 $ files ->shouldReceive ('get ' )->once ()->with ('foo ' )->andReturn ($ content );
106- $ files ->shouldReceive ('put ' )->once ()->with (__DIR__ .'/ ' .sha1 ('foo ' ).'.php ' , $ compiled );
106+ $ files ->shouldReceive ('put ' )->once ()->with (__DIR__ .'/ ' .sha1 ('v2foo ' ).'.php ' , $ compiled );
107107
108108 $ compiler ->compile ('foo ' );
109109 }
@@ -157,7 +157,7 @@ public function testDontIncludeEmptyPath()
157157 {
158158 $ compiler = new BladeCompiler ($ files = $ this ->getFiles (), __DIR__ );
159159 $ files ->shouldReceive ('get ' )->once ()->with ('' )->andReturn ('Hello World ' );
160- $ files ->shouldReceive ('put ' )->once ()->with (__DIR__ .'/ ' .sha1 ('' ).'.php ' , 'Hello World ' );
160+ $ files ->shouldReceive ('put ' )->once ()->with (__DIR__ .'/ ' .sha1 ('v2 ' ).'.php ' , 'Hello World ' );
161161 $ compiler ->setPath ('' );
162162 $ compiler ->compile ();
163163 }
@@ -166,7 +166,7 @@ public function testDontIncludeNullPath()
166166 {
167167 $ compiler = new BladeCompiler ($ files = $ this ->getFiles (), __DIR__ );
168168 $ files ->shouldReceive ('get ' )->once ()->with (null )->andReturn ('Hello World ' );
169- $ files ->shouldReceive ('put ' )->once ()->with (__DIR__ .'/ ' .sha1 (null ).'.php ' , 'Hello World ' );
169+ $ files ->shouldReceive ('put ' )->once ()->with (__DIR__ .'/ ' .sha1 (' v2 ' ).'.php ' , 'Hello World ' );
170170 $ compiler ->setPath (null );
171171 $ compiler ->compile ();
172172 }
0 commit comments