File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,18 @@ class VTTPreviewThumbnailsGeneratorTest extends TestCase
10
10
{
11
11
use MatchesSnapshots;
12
12
13
+ private function updateWindowsNewLines ($ content )
14
+ {
15
+ if (!windows_os ()) {
16
+ return $ content ;
17
+ }
18
+
19
+ $ content = str_replace ("\r\n" , "\n" , $ content );
20
+ $ content = str_replace ("\n" , "\r\n" , $ content );
21
+
22
+ return $ content ;
23
+ }
24
+
13
25
/** @test */
14
26
public function it_can_generate_a_vtt_file ()
15
27
{
@@ -22,7 +34,7 @@ public function it_can_generate_a_vtt_file()
22
34
23
35
$ generator = new VTTPreviewThumbnailsGenerator ($ tile , 250 , fn () => "sprite_%d.jpg " );
24
36
25
- $ this ->assertMatchesTextSnapshot ($ generator ->getContents ());
37
+ $ this ->assertMatchesTextSnapshot ($ this -> updateWindowsNewLines ( $ generator ->getContents () ));
26
38
}
27
39
28
40
/** @test */
@@ -39,7 +51,7 @@ public function it_can_generate_a_vtt_file_with_a_non_sqaure_grid()
39
51
return "sprite_ {$ i }.jpg " ;
40
52
});
41
53
42
- $ this ->assertMatchesTextSnapshot ($ generator ->getContents ());
54
+ $ this ->assertMatchesTextSnapshot ($ this -> updateWindowsNewLines ( $ generator ->getContents () ));
43
55
}
44
56
45
57
/** @test */
@@ -58,6 +70,6 @@ public function it_can_generate_a_vtt_file_and_keep_the_margin_and_padding_in_ac
58
70
return "sprite_ {$ i }.jpg " ;
59
71
});
60
72
61
- $ this ->assertMatchesTextSnapshot ($ generator ->getContents ());
73
+ $ this ->assertMatchesTextSnapshot ($ this -> updateWindowsNewLines ( $ generator ->getContents () ));
62
74
}
63
75
}
You can’t perform that action at this time.
0 commit comments