making unit tests work with spans

This commit is contained in:
El RIDO 2017-03-02 19:44:43 +01:00
parent 85aa072234
commit d358271451
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
3 changed files with 12 additions and 12 deletions

View File

@ -396,11 +396,11 @@ if ($FILEUPLOAD):
<?php
endif;
?>
<div id="status" role="alert" class="statusmessage alert alert-info <?php echo empty($STATUS) ? 'hidden' : '' ?>">
<div id="status" role="alert" class="statusmessage alert alert-info<?php echo empty($STATUS) ? ' hidden' : '' ?>">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
<span class="pl-1"><?php echo htmlspecialchars($STATUS); ?></span>
</div>
<div id="errormessage" role="alert" class="statusmessage <?php echo empty($ERROR) ? 'hidden' : '' ?> alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span><span class="pl-1"><?php echo htmlspecialchars($ERROR); ?></span></div>
<div id="errormessage" role="alert" class="statusmessage<?php echo empty($ERROR) ? ' hidden' : '' ?> alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span><span class="pl-1"><?php echo htmlspecialchars($ERROR); ?></span></div>
<noscript><div id="noscript" role="alert" class="nonworking alert alert-<?php echo $isDark ? 'error' : 'warning'; ?>"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span><?php echo I18n::_('JavaScript is required for %s to work.<br />Sorry for the inconvenience.', I18n::_($NAME)); ?></div></noscript>
<div id="oldienotice" role="alert" class="hidden nonworking alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span><?php echo I18n::_('%s requires a modern browser to work.', I18n::_($NAME)); ?></div>
<div id="ienotice" role="alert" class="hidden alert alert-<?php echo $isDark ? 'error' : 'warning'; ?>"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span><?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'), PHP_EOL; ?>

View File

@ -760,7 +760,7 @@ class PrivateBinTest extends PHPUnit_Framework_TestCase
$content = ob_get_contents();
ob_end_clean();
$this->assertRegExp(
'#<div[^>]*id="errormessage"[^>]*>.*Invalid paste ID\.</div>#',
'#<div[^>]*id="errormessage"[^>]*>.*Invalid paste ID\.</#',
$content,
'outputs error correctly'
);
@ -778,7 +778,7 @@ class PrivateBinTest extends PHPUnit_Framework_TestCase
$content = ob_get_contents();
ob_end_clean();
$this->assertRegExp(
'#<div[^>]*id="errormessage"[^>]*>.*Paste does not exist[^<]*</div>#',
'#<div[^>]*id="errormessage"[^>]*>.*Paste does not exist, has expired or has been deleted\.</#',
$content,
'outputs error correctly'
);
@ -798,7 +798,7 @@ class PrivateBinTest extends PHPUnit_Framework_TestCase
$content = ob_get_contents();
ob_end_clean();
$this->assertRegExp(
'#<div[^>]*id="errormessage"[^>]*>.*Paste does not exist[^<]*</div>#',
'#<div[^>]*id="errormessage"[^>]*>.*Paste does not exist, has expired or has been deleted\.</#',
$content,
'outputs error correctly'
);
@ -939,7 +939,7 @@ class PrivateBinTest extends PHPUnit_Framework_TestCase
$content = ob_get_contents();
ob_end_clean();
$this->assertRegExp(
'#<div[^>]*id="status"[^>]*>.*Paste was properly deleted[^<]*</div>#s',
'#<div[^>]*id="status"[^>]*>.*Paste was properly deleted\.</#s',
$content,
'outputs deleted status correctly'
);
@ -960,7 +960,7 @@ class PrivateBinTest extends PHPUnit_Framework_TestCase
$content = ob_get_contents();
ob_end_clean();
$this->assertRegExp(
'#<div[^>]*id="errormessage"[^>]*>.*Invalid paste ID\.</div>#',
'#<div[^>]*id="errormessage"[^>]*>.*Invalid paste ID\.</#',
$content,
'outputs delete error correctly'
);
@ -980,7 +980,7 @@ class PrivateBinTest extends PHPUnit_Framework_TestCase
$content = ob_get_contents();
ob_end_clean();
$this->assertRegExp(
'#<div[^>]*id="errormessage"[^>]*>.*Paste does not exist[^<]*</div>#',
'#<div[^>]*id="errormessage"[^>]*>.*Paste does not exist, has expired or has been deleted\.</#',
$content,
'outputs delete error correctly'
);
@ -1000,7 +1000,7 @@ class PrivateBinTest extends PHPUnit_Framework_TestCase
$content = ob_get_contents();
ob_end_clean();
$this->assertRegExp(
'#<div[^>]*id="errormessage"[^>]*>.*Wrong deletion token[^<]*</div>#',
'#<div[^>]*id="errormessage"[^>]*>.*Wrong deletion token\. Paste was not deleted\.</#',
$content,
'outputs delete error correctly'
);
@ -1067,7 +1067,7 @@ class PrivateBinTest extends PHPUnit_Framework_TestCase
$content = ob_get_contents();
ob_end_clean();
$this->assertRegExp(
'#<div[^>]*id="errormessage"[^>]*>.*Paste does not exist[^<]*</div>#',
'#<div[^>]*id="errormessage"[^>]*>.*Paste does not exist, has expired or has been deleted\.</#',
$content,
'outputs error correctly'
);
@ -1091,7 +1091,7 @@ class PrivateBinTest extends PHPUnit_Framework_TestCase
$content = ob_get_contents();
ob_end_clean();
$this->assertRegExp(
'#<div[^>]*id="status"[^>]*>.*Paste was properly deleted[^<]*</div>#s',
'#<div[^>]*id="status"[^>]*>.*Paste was properly deleted\.</#s',
$content,
'outputs deleted status correctly'
);

View File

@ -104,7 +104,7 @@ class ViewTest extends PHPUnit_Framework_TestCase
$template . ': outputs data correctly'
);
$this->assertRegExp(
'#<div[^>]+id="errormessage"[^>]*>.*' . self::$error . '</div>#',
'#<div[^>]+id="errormessage"[^>]*>.*' . self::$error . '</#',
$content,
$template . ': outputs error correctly'
);