@@ -905,30 +905,34 @@ public function test_optimize_sets_both_format_and_quality()
905905 public function test_to_html ()
906906 {
907907 $ image = $ this ->makeImage ();
908- $ this ->assertStringStartsWith ('<img src=" ' );
909- $ this ->assertStringEndsWith ('" width="100" height="100"> ' , $ image ->toHtml ());
908+ $ html = $ image ->toHtml ();
909+ $ this ->assertStringStartsWith ('<img src=" ' , $ html );
910+ $ this ->assertStringEndsWith ('" width="100" height="100"> ' , $ html );
910911
911912 $ result = $ image ->scale (400 , 400 );
912- $ this ->assertStringStartsWith ('<img src=" ' );
913- $ this ->assertStringEndsWith ('" width="100" height="100"> ' , $ image ->toHtml ());
913+ $ html = $ image ->toHtml ();
914+ $ this ->assertStringStartsWith ('<img src=" ' , $ html );
915+ $ this ->assertStringEndsWith ('" width="100" height="100"> ' , $ html );
914916 }
915917
916918 public function test_to_html_with_additional_attributes ()
917919 {
918920 $ image = $ this ->makeImage ();
919921
920922 $ result = $ image ->scale (400 , 400 );
921- $ this ->assertStringStartsWith ('<img src=" ' );
922- $ this ->assertStringEndsWith ('" width="100" height="100" alt="My avatar" hidden> ' , $ image ->toHtml (['alt ' => 'My avatar ' , 'hidden ' ]));
923+ $ html = $ image ->toHtml (['alt ' => 'My avatar ' , 'hidden ' ]);
924+ $ this ->assertStringStartsWith ('<img src=" ' , $ html );
925+ $ this ->assertStringEndsWith ('" width="100" height="100" alt="My avatar" hidden> ' , $ html );
923926 }
924927
925928 public function test_to_html_attributes_are_overwritable ()
926929 {
927930 $ image = $ this ->makeImage ();
928931
929932 $ result = $ image ->scale (400 , 400 );
930- $ this ->assertStringStartsWith ('<img src=" ' );
931- $ this ->assertStringEndsWith ('" width="100" height="42"> ' , $ image ->toHtml (['height ' => 42 ]));
933+ $ html = $ image ->toHtml (['height ' => 42 ])
934+ $ this ->assertStringStartsWith ('<img src=" ' , $ html );
935+ $ this ->assertStringEndsWith ('" width="100" height="42"> ' , $ html );
932936 }
933937
934938 public function test_optimize_allows_gif ()
0 commit comments