@@ -102,7 +102,7 @@ public function testMultilineEsiRemoveTagsAreRemoved()
102
102
$ response = new Response ('<esi:remove> <a href="http://www.example.com">www.example.com</a> </esi:remove> Keep this ' ."<esi:remove> \n <a>www.example.com</a> </esi:remove> And this " );
103
103
$ this ->assertSame ($ response , $ esi ->process ($ request , $ response ));
104
104
105
- $ this ->assertEquals (' Keep this And this ' , $ response ->getContent ());
105
+ $ this ->assertEquals(' Keep this And this ' , substr ( $ response ->getContent (), 24 , - 24 ));
106
106
}
107
107
108
108
public function testCommentTagsAreRemoved ()
@@ -113,7 +113,7 @@ public function testCommentTagsAreRemoved()
113
113
$ response = new Response ('<esi:comment text="some comment >" /> Keep this ' );
114
114
$ this ->assertSame ($ response , $ esi ->process ($ request , $ response ));
115
115
116
- $ this ->assertEquals (' Keep this ' , $ response ->getContent ());
116
+ $ this ->assertEquals (' Keep this ' , substr ( $ response ->getContent (), 24 , - 24 ));
117
117
}
118
118
119
119
public function testProcess ()
@@ -124,23 +124,27 @@ public function testProcess()
124
124
$ response = new Response ('foo <esi:comment text="some comment" /><esi:include src="..." alt="alt" onerror="continue" /> ' );
125
125
$ this ->assertSame ($ response , $ esi ->process ($ request , $ response ));
126
126
127
- $ this ->assertEquals ('foo <?php echo $this->surrogate->handle($this, \'... \', \'alt \', true) ?> ' ."\n" , $ response ->getContent ());
127
+ $ content = explode (substr ($ response ->getContent (), 0 , 24 ), $ response ->getContent ());
128
+ $ this ->assertSame (['' , 'foo ' , "... \nalt \n1 \n" , '' ], $ content );
128
129
$ this ->assertEquals ('ESI ' , $ response ->headers ->get ('x-body-eval ' ));
129
130
130
131
$ response = new Response ('foo <esi:comment text="some comment" /><esi:include src="foo \'" alt="bar \'" onerror="continue" /> ' );
131
132
$ this ->assertSame ($ response , $ esi ->process ($ request , $ response ));
132
133
133
- $ this ->assertEquals ('foo <?php echo $this->surrogate->handle($this, \'foo \\\'\', \'bar \\\'\', true) ?> ' ."\n" , $ response ->getContent ());
134
+ $ content = explode (substr ($ response ->getContent (), 0 , 24 ), $ response ->getContent ());
135
+ $ this ->assertSame (['' , 'foo ' , "foo' \nbar' \n1 \n" , '' ], $ content );
134
136
135
137
$ response = new Response ('foo <esi:include src="..." /> ' );
136
138
$ this ->assertSame ($ response , $ esi ->process ($ request , $ response ));
137
139
138
- $ this ->assertEquals ('foo <?php echo $this->surrogate->handle($this, \'... \', \'\', false) ?> ' ."\n" , $ response ->getContent ());
140
+ $ content = explode (substr ($ response ->getContent (), 0 , 24 ), $ response ->getContent ());
141
+ $ this ->assertSame (['' , 'foo ' , "... \n\n\n" , '' ], $ content );
139
142
140
143
$ response = new Response ('foo <esi:include src="..."></esi:include> ' );
141
144
$ this ->assertSame ($ response , $ esi ->process ($ request , $ response ));
142
145
143
- $ this ->assertEquals ('foo <?php echo $this->surrogate->handle($this, \'... \', \'\', false) ?> ' ."\n" , $ response ->getContent ());
146
+ $ content = explode (substr (<
10000
span class=pl-c1>$ response->getContent (), 0 , 24 ), $ response ->getContent ());
147
+ $ this ->assertSame (['' , 'foo ' , "... \n\n\n" , '' ], $ content );
144
148
}
145
149
146
150
public function testProcessEscapesPhpTags ()
@@ -151,7 +155,8 @@ public function testProcessEscapesPhpTags()
151
155
$ response = new Response ('<?php <? <% <script language=php> ' );
152
156
$ this ->assertSame ($ response , $ esi ->process ($ request , $ response ));
153
157
154
- $ this ->assertEquals ('<?php echo "<?"; ?>php <?php echo "<?"; ?> <?php echo "<%"; ?> <?php echo "<s"; ?>cript language=php> ' , $ response ->getContent ());
158
+ $ content = explode (substr ($ response ->getContent (), 0 , 24 ), $ response ->getContent ());
159
+ $ this ->assertSame (['' , '<?php <? <% <script language=php> ' , '' ], $ content );
155
160
}
156
161
157
162
public function testProcessWhenNoSrcInAnEsi ()
0 commit comments