@@ -20,7 +20,7 @@ public function testRenderFunctionReturnsHtml()
20
20
$ markdown = new Markdown ($ viewFactory );
21
21
$ viewFactory ->shouldReceive ('flushFinderCache ' )->once ();
22
22
$ viewFactory ->shouldReceive ('replaceNamespace ' )->once ()->with ('mail ' , $ markdown ->htmlComponentPaths ())->andReturnSelf ();
23
- $ viewFactory ->shouldReceive ('exists ' )->with ('default ' )->andReturn (false );
23
+ $ viewFactory ->shouldReceive ('exists ' )->with ('mail. default ' )->andReturn (false );
24
24
$ viewFactory ->shouldReceive ('make ' )->with ('view ' , [])->andReturnSelf ();
25
25
$ viewFactory ->shouldReceive ('make ' )->with ('mail::themes.default ' , [])->andReturnSelf ();
26
26
$ viewFactory ->shouldReceive ('render ' )->twice ()->andReturn ('<html></html> ' , 'body {} ' );
@@ -37,9 +37,26 @@ public function testRenderFunctionReturnsHtmlWithCustomTheme()
37
37
$ markdown ->theme ('yaz ' );
38
38
$ viewFactory ->shouldReceive ('flushFinderCache ' )->once ();
39
39
$ viewFactory ->shouldReceive ('replaceNamespace ' )->once ()->with ('mail ' , $ markdown ->htmlComponentPaths ())->andReturnSelf ();
40
- $ viewFactory ->shouldReceive ('exists ' )->with ('yaz ' )->andReturn (true );
40
+ $ viewFactory ->shouldReceive ('exists ' )->with ('mail. yaz ' )->andReturn (true );
41
41
$ viewFactory ->shouldReceive ('make ' )->with ('view ' , [])->andReturnSelf ();
42
- $ viewFactory ->shouldReceive ('make ' )->with ('yaz ' , [])->andReturnSelf ();
42
+ $ viewFactory ->shouldReceive ('make ' )->with ('mail.yaz ' , [])->andReturnSelf ();
43
+ $ viewFactory ->shouldReceive ('render ' )->twice ()->andReturn ('<html></html> ' , 'body {} ' );
44
+
45
+ $ result = $ markdown ->render ('view ' , []);
46
+
47
+ $ this ->assertNotFalse (strpos ($ result , '<html></html> ' ));
48
+ }
49
+
50
+ public function testRenderFunctionReturnsHtmlWithCustomThemeWithMailPrefix ()
51
+ {
52
+ $ viewFactory = m::mock (Factory::class);
53
+ $ markdown = new Markdown ($ viewFactory );
54
+ $ markdown ->theme ('mail.yaz ' );
55
+ $ viewFactory ->shouldReceive ('flushFinderCache ' )->once ();
56
+ $ viewFactory ->shouldReceive ('replaceNamespace ' )->once ()->with ('mail ' , $ markdown ->htmlComponentPaths ())->andReturnSelf ();
57
+ $ viewFactory ->shouldReceive ('exists ' )->with ('mail.yaz ' )->andReturn (true );
58
+ $ viewFactory ->shouldReceive ('make ' )->with ('view ' , [])->andReturnSelf ();
59
+ $ viewFactory ->shouldReceive ('make ' )->with ('mail.yaz ' , [])->andReturnSelf ();
43
60
$ viewFactory ->shouldReceive ('render ' )->twice ()->andReturn ('<html></html> ' , 'body {} ' );
44
61
45
62
$ result = $ markdown ->render ('view ' , []);
0 commit comments