@@ -22,7 +22,7 @@ public function testProccessHTML()
2222
2323 $ compiler = new \IvoPetkov \HTMLServerComponentsCompiler ();
2424 $ result = $ compiler ->process ('<component src="file: ' . $ fullFilename . '"/> ' );
25- $ expectedResult = '<!DOCTYPE html><html><head><meta custom="value"></head><body>text1</body></html> ' ;
25+ $ expectedResult = '<!DOCTYPE html> ' . "\n" . ' <html><head><meta custom="value"></head><body>text1</body></html> ' ;
2626 $ this ->assertTrue ($ result === $ expectedResult );
2727
2828 $ compiler = new \IvoPetkov \HTMLServerComponentsCompiler ();
@@ -31,7 +31,7 @@ public function testProccessHTML()
3131 . '<component src="file: ' . $ fullFilename . '"/> '
3232 . 'text2 '
3333 . '</body></html> ' );
34- $ expectedResult = '<!DOCTYPE html><html><head><meta custom="value"></head><body> '
34+ $ expectedResult = '<!DOCTYPE html> ' . "\n" . ' <html><head><meta custom="value"></head><body> '
3535 . 'text0 '
3636 . 'text1 '
3737 . 'text2 '
@@ -49,7 +49,7 @@ public function testAlias()
4949 $ compiler = new \IvoPetkov \HTMLServerComponentsCompiler ();
5050 $ compiler ->addAlias ('component1 ' , 'file: ' . $ fullFilename );
5151
52- $ expectedResult = '<!DOCTYPE html><html><body>text1</body></html> ' ;
52+ $ expectedResult = '<!DOCTYPE html> ' . "\n" . ' <html><body>text1</body></html> ' ;
5353
5454 $ result = $ compiler ->process ('<component src="file: ' . $ fullFilename . '" /> ' );
5555 $ this ->assertTrue ($ result === $ expectedResult );
@@ -88,7 +88,7 @@ public function testVariables()
8888 'test2 ' => 2
8989 ]
9090 ]);
91- $ expectedResult = '<!DOCTYPE html><html><body>12</body></html> ' ;
91+ $ expectedResult = '<!DOCTYPE html> ' . "\n" . ' <html><body>12</body></html> ' ;
9292 $ this ->assertTrue ($ result === $ expectedResult );
9393 }
9494
@@ -103,11 +103,11 @@ public function testProccessRecursion()
103103
104104 $ compiler = new \IvoPetkov \HTMLServerComponentsCompiler ();
105105 $ result = $ compiler ->process ('<component src="file: ' . $ fullFilename3 . '"/> ' );
106- $ expectedResult = '<!DOCTYPE html><html><head><meta custom="value3"><meta custom="value2"><meta custom="value1"></head><body>text1text2text3</body></html> ' ;
106+ $ expectedResult = '<!DOCTYPE html> ' . "\n" . ' <html><head><meta custom="value3"><meta custom="value2"><meta custom="value1"></head><body>text1text2text3</body></html> ' ;
107107 $ this ->assertTrue ($ result === $ expectedResult );
108108
109109 $ result = $ compiler ->process ('<component src="file: ' . $ fullFilename3 . '"/> ' , ['recursive ' => false ]);
110- $ expectedResult = '<!DOCTYPE html><html><head><meta custom="value3"></head><body><component src="file: ' . urlencode ($ fullFilename2 ) . '"></component>text3</body></html> ' ;
110+ $ expectedResult = '<!DOCTYPE html> ' . "\n" . ' <html><head><meta custom="value3"></head><body><component src="file: ' . urlencode ($ fullFilename2 ) . '"></component>text3</body></html> ' ;
111111 $ this ->assertTrue ($ result === $ expectedResult );
112112 }
113113
@@ -119,7 +119,7 @@ public function testProccessData()
119119
120120 $ compiler = new \IvoPetkov \HTMLServerComponentsCompiler ();
121121 $ result = $ compiler ->process ('<component src="data:base64, ' . base64_encode ('<html><body>text1</body></html> ' ) . '" /> ' );
122- $ expectedResult = '<!DOCTYPE html><html><body>text1</body></html> ' ;
122+ $ expectedResult = '<!DOCTYPE html> ' . "\n" . ' <html><body>text1</body></html> ' ;
123123 $ this ->assertTrue ($ result === $ expectedResult );
124124 }
125125
@@ -134,7 +134,7 @@ public function testComponentInComponentInnerHTML()
134134
135135 $ compiler = new \IvoPetkov \HTMLServerComponentsCompiler ();
136136 $ result = $ compiler ->process ('<component src="file: ' . $ fullFilename2 . '"><component src="file: ' . $ fullFilename1 . '"/></component> ' );
137- $ expectedResult = '<!DOCTYPE html><html><head><title>hi</title></head><body>text1</body></html> ' ;
137+ $ expectedResult = '<!DOCTYPE html> ' . "\n" . ' <html><head><title>hi</title></head><body>text1</body></html> ' ;
138138 $ this ->assertTrue ($ result === $ expectedResult );
139139 }
140140
@@ -158,7 +158,7 @@ public function testComponentAttribute()
158158 $ component ->src = 'file: ' . $ fullFilename ;
159159 $ component ->test1 = '1 ' ;
160160 $ result = $ compiler ->process ($ component );
161- $ expectedResult = '<!DOCTYPE html><html><body>1210</body></html> ' ;
161+ $ expectedResult = '<!DOCTYPE html> ' . "\n" . ' <html><body>1210</body></html> ' ;
162162 $ this ->assertTrue ($ result === $ expectedResult );
163163 }
164164
0 commit comments