@@ -18,7 +18,7 @@ protected function tearDown(): void
18
18
public function testIsExpiredReturnsTrueIfCompiledFileDoesntExist ()
19
19
{
20
20
$ 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 );
22
22
$ this ->assertTrue ($ compiler ->isExpired ('foo ' ));
23
23
}
24
24
@@ -33,31 +33,31 @@ public function testCannotConstructWithBadCachePath()
33
33
public function testIsExpiredReturnsTrueWhenModificationTimesWarrant ()
34
34
{
35
35
$ 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 );
37
37
$ 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 );
39
39
$ this ->assertTrue ($ compiler ->isExpired ('foo ' ));
40
40
}
41
41
42
42
public function testCompilePathIsProperlyCreated ()
43
43
{
44
44
$ 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 ' ));
46
46
}
47
47
48
48
public function testCompileCompilesFileAndReturnsContents ()
49
49
{
50
50
$ compiler = new BladeCompiler ($ files = $ this ->getFiles (), __DIR__ );
51
51
$ 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**/ ?> ' );
53
53
$ compiler ->compile ('foo ' );
54
54
}
55
55
56
56
public function testCompileCompilesAndGetThePath ()
57
57
{
58
58
$ compiler = new BladeCompiler ($ files = $ this ->getFiles (), __DIR__ );
59
59
$ 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**/ ?> ' );
61
61
$ compiler ->compile ('foo ' );
62
62
$ this ->assertSame ('foo ' , $ compiler ->getPath ());
63
63
}
@@ -73,7 +73,7 @@ public function testCompileWithPathSetBefore()
73
73
{
74
74
$ compiler = new BladeCompiler ($ files = $ this ->getFiles (), __DIR__ );
75
75
$ 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**/ ?> ' );
77
77
// set path before compilation
78
78
$ compiler ->setPath ('foo ' );
79
79
// trigger compilation with $path
@@ -103,7 +103,7 @@ public function testIncludePathToTemplate($content, $compiled)
103
103
{
104
104
$ compiler = new BladeCompiler ($ files = $ this ->getFiles (), __DIR__ );
105
105
$ 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 );
107
107
108
108
$ compiler ->compile ('foo ' );
109
109
}
@@ -157,7 +157,7 @@ public function testDontIncludeEmptyPath()
157
157
{
158
158
$ compiler = new BladeCompiler ($ files = $ this ->getFiles (), __DIR__ );
159
159
$ 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 ' );
161
161
$ compiler ->setPath ('' );
162
162
$ compiler ->compile ();
163
163
}
@@ -166,7 +166,7 @@ public function testDontIncludeNullPath()
166
166
{
167
167
$ compiler = new BladeCompiler ($ files = $ this ->getFiles (), __DIR__ );
168
168
$ 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 ' );
170
170
$ compiler ->setPath (null );
171
171
$ compiler ->compile ();
172
172
}
0 commit comments