comparison vendor/behat/mink/src/WebAssert.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents 5311817fb629
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
188 public function responseHeaderContains($name, $value) 188 public function responseHeaderContains($name, $value)
189 { 189 {
190 $actual = $this->session->getResponseHeader($name); 190 $actual = $this->session->getResponseHeader($name);
191 $message = sprintf('The text "%s" was not found anywhere in the "%s" response header.', $value, $name); 191 $message = sprintf('The text "%s" was not found anywhere in the "%s" response header.', $value, $name);
192 192
193 $this->assert(false !== stripos($actual, $value), $message); 193 $this->assert(false !== stripos($actual, (string) $value), $message);
194 } 194 }
195 195
196 /** 196 /**
197 * Checks that current response header does not contain value. 197 * Checks that current response header does not contain value.
198 * 198 *
204 public function responseHeaderNotContains($name, $value) 204 public function responseHeaderNotContains($name, $value)
205 { 205 {
206 $actual = $this->session->getResponseHeader($name); 206 $actual = $this->session->getResponseHeader($name);
207 $message = sprintf('The text "%s" was found in the "%s" response header, but it should not.', $value, $name); 207 $message = sprintf('The text "%s" was found in the "%s" response header, but it should not.', $value, $name);
208 208
209 $this->assert(false === stripos($actual, $value), $message); 209 $this->assert(false === stripos($actual, (string) $value), $message);
210 } 210 }
211 211
212 /** 212 /**
213 * Checks that current response header matches regex. 213 * Checks that current response header matches regex.
214 * 214 *
319 public function responseContains($text) 319 public function responseContains($text)
320 { 320 {
321 $actual = $this->session->getPage()->getContent(); 321 $actual = $this->session->getPage()->getContent();
322 $message = sprintf('The string "%s" was not found anywhere in the HTML response of the current page.', $text); 322 $message = sprintf('The string "%s" was not found anywhere in the HTML response of the current page.', $text);
323 323
324 $this->assert(stripos($actual, $text) !== false, $message); 324 $this->assert(stripos($actual, (string) $text) !== false, $message);
325 } 325 }
326 326
327 /** 327 /**
328 * Checks that page HTML (response content) does not contains text. 328 * Checks that page HTML (response content) does not contains text.
329 * 329 *
334 public function responseNotContains($text) 334 public function responseNotContains($text)
335 { 335 {
336 $actual = $this->session->getPage()->getContent(); 336 $actual = $this->session->getPage()->getContent();
337 $message = sprintf('The string "%s" appears in the HTML response of this page, but it should not.', $text); 337 $message = sprintf('The string "%s" appears in the HTML response of this page, but it should not.', $text);
338 338
339 $this->assert(stripos($actual, $text) === false, $message); 339 $this->assert(stripos($actual, (string) $text) === false, $message);
340 } 340 }
341 341
342 /** 342 /**
343 * Checks that page HTML (response content) matches regex. 343 * Checks that page HTML (response content) matches regex.
344 * 344 *