make tests compatible with newer phpunit
This commit is contained in:
parent
8ed9fccf25
commit
27965d0287
@ -66,7 +66,7 @@ class ControllerTest extends TestCase
|
|||||||
$content,
|
$content,
|
||||||
'doesn\'t output shortener button'
|
'doesn\'t output shortener button'
|
||||||
);
|
);
|
||||||
$this->assertRegExp(
|
$this->assertMatchesRegularExpression(
|
||||||
'# href="https://' . preg_quote($_SERVER['HTTP_HOST']) . '/">switching to HTTPS#',
|
'# href="https://' . preg_quote($_SERVER['HTTP_HOST']) . '/">switching to HTTPS#',
|
||||||
$content,
|
$content,
|
||||||
'outputs configured https URL correctly'
|
'outputs configured https URL correctly'
|
||||||
|
@ -189,7 +189,7 @@ class I18nTest extends TestCase
|
|||||||
foreach (array_keys($languages) as $language) {
|
foreach (array_keys($languages) as $language) {
|
||||||
// most languages don't translate the data size units, ignore those
|
// most languages don't translate the data size units, ignore those
|
||||||
if ($messageId !== 'B' && strlen($messageId) !== 3 && strpos($messageId, 'B', 2) !== 2) {
|
if ($messageId !== 'B' && strlen($messageId) !== 3 && strpos($messageId, 'B', 2) !== 2) {
|
||||||
$this->assertContains(
|
$this->assertStringContains(
|
||||||
$messageId,
|
$messageId,
|
||||||
$languages[$language],
|
$languages[$language],
|
||||||
"message ID '$messageId' exists in translation file $language.json"
|
"message ID '$messageId' exists in translation file $language.json"
|
||||||
|
@ -287,7 +287,7 @@ class JsonApiTest extends TestCase
|
|||||||
new Controller;
|
new Controller;
|
||||||
$content = ob_get_contents();
|
$content = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
$this->assertContains('id="pasteurl" href="https://example.com/1"', $content, 'outputs shortened URL correctly');
|
$this->assertStringContains('id="pasteurl" href="https://example.com/1"', $content, 'outputs shortened URL correctly');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -301,6 +301,6 @@ class JsonApiTest extends TestCase
|
|||||||
new Controller;
|
new Controller;
|
||||||
$content = ob_get_contents();
|
$content = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
$this->assertContains('Error calling YOURLS.', $content, 'outputs error correctly');
|
$this->assertStringContains('Error calling YOURLS.', $content, 'outputs error correctly');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user