mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
fix: Change assertTextContains()/assertTextNotContains() to match changes in PHPUnit API
This commit is contained in:
parent
e8453a04d4
commit
0a05486693
1 changed files with 8 additions and 2 deletions
|
@ -296,7 +296,10 @@ abstract class CakeTestCase extends \PHPUnit\Framework\TestCase {
|
||||||
public function assertTextContains($needle, $haystack, $message = '', $ignoreCase = false) {
|
public function assertTextContains($needle, $haystack, $message = '', $ignoreCase = false) {
|
||||||
$needle = str_replace(array("\r\n", "\r"), "\n", $needle);
|
$needle = str_replace(array("\r\n", "\r"), "\n", $needle);
|
||||||
$haystack = str_replace(array("\r\n", "\r"), "\n", $haystack);
|
$haystack = str_replace(array("\r\n", "\r"), "\n", $haystack);
|
||||||
return $this->assertContains($needle, $haystack, $message, $ignoreCase);
|
if ($ignoreCase) {
|
||||||
|
return $this->assertStringContainsStringIgnoringCase($needle, $haystack, $message);
|
||||||
|
}
|
||||||
|
return $this->assertStringContainsString($needle, $haystack, $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -312,7 +315,10 @@ abstract class CakeTestCase extends \PHPUnit\Framework\TestCase {
|
||||||
public function assertTextNotContains($needle, $haystack, $message = '', $ignoreCase = false) {
|
public function assertTextNotContains($needle, $haystack, $message = '', $ignoreCase = false) {
|
||||||
$needle = str_replace(array("\r\n", "\r"), "\n", $needle);
|
$needle = str_replace(array("\r\n", "\r"), "\n", $needle);
|
||||||
$haystack = str_replace(array("\r\n", "\r"), "\n", $haystack);
|
$haystack = str_replace(array("\r\n", "\r"), "\n", $haystack);
|
||||||
return $this->assertNotContains($needle, $haystack, $message, $ignoreCase);
|
if ($ignoreCase) {
|
||||||
|
return $this->assertStringNotContainsStringIgnoringCase($needle, $haystack, $message);
|
||||||
|
}
|
||||||
|
return $this->assertStringNotContainsString($needle, $haystack, $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue