33namespace Torchlight \Commonmark \Tests ;
44
55use Illuminate \Support \Facades \Http ;
6- use Torchlight \Block ;
7- use Torchlight \Client ;
8- use Torchlight \Commonmark \TorchlightExtension ;
96use League \CommonMark \DocParser ;
107use League \CommonMark \Environment ;
118use League \CommonMark \HtmlRenderer ;
129use Orchestra \Testbench \TestCase ;
10+ use Torchlight \Block ;
11+ use Torchlight \Commonmark \TorchlightExtension ;
1312
1413class CodeRendererTest extends TestCase
1514{
16-
1715 protected function getEnvironmentSetUp ($ app )
1816 {
1917 config ()->set ('torchlight.token ' , 'token ' );
@@ -55,9 +53,9 @@ public function it_highlights_code_blocks()
5553EOT;
5654
5755 $ response = [
58- " blocks " => [[
59- " id " => " block_id_1 " ,
60- " wrapped " => " <pre><code>highlighted</code></pre> " ,
56+ ' blocks ' => [[
57+ ' id ' => ' block_id_1 ' ,
58+ ' wrapped ' => ' <pre><code>highlighted</code></pre> ' ,
6159 ]]
6260 ];
6361
@@ -94,9 +92,8 @@ public function gets_language_and_contents()
9492 $ this ->render ($ markdown );
9593
9694 Http::assertSent (function ($ request ) {
97- return $ request ['blocks ' ][0 ]['language ' ] === "foobarlang "
98- && $ request ['blocks ' ][0 ]['code ' ] === "<div>test</div> " ;
99-
95+ return $ request ['blocks ' ][0 ]['language ' ] === 'foobarlang '
96+ && $ request ['blocks ' ][0 ]['code ' ] === '<div>test</div> ' ;
10097 });
10198 }
10299
@@ -121,23 +118,22 @@ public function it_sends_one_request_only_and_matches_by_id()
121118EOT;
122119
123120 $ response = [
124- " blocks " => [[
125- " id " => " block_id_3 " ,
126- " wrapped " => " some js " ,
121+ ' blocks ' => [[
122+ ' id ' => ' block_id_3 ' ,
123+ ' wrapped ' => ' some js ' ,
127124 ], [
128- " id " => " block_id_1 " ,
129- " wrapped " => " some php " ,
125+ ' id ' => ' block_id_1 ' ,
126+ ' wrapped ' => ' some php ' ,
130127 ], [
131- " id " => " block_id_2 " ,
132- " wrapped " => " some ruby " ,
128+ ' id ' => ' block_id_2 ' ,
129+ ' wrapped ' => ' some ruby ' ,
133130 ]]
134131 ];
135132
136133 Http::fake ([
137134 'api.torchlight.dev/* ' => Http::response ($ response , 200 ),
138135 ]);
139136
140-
141137 $ html = $ this ->render ($ markdown );
142138
143139 Http::assertSentCount (1 );
@@ -153,6 +149,4 @@ public function it_sends_one_request_only_and_matches_by_id()
153149
154150 $ this ->assertEquals ($ expected , $ html );
155151 }
156-
157-
158- }
152+ }
0 commit comments