mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-09-18 03:34:40 -04:00
made phpUnit and most mocha tests work again, had to remove some injected objects and added a helper method to facilitate a cache reset for the unit tests. Page template is still broken and the JS test for baseUri() fails
This commit is contained in:
parent
e880f7924c
commit
131e08ca33
6 changed files with 241 additions and 221 deletions
|
@ -96,10 +96,10 @@ class ViewTest extends PHPUnit_Framework_TestCase
|
|||
public function testTemplateRendersCorrectly()
|
||||
{
|
||||
foreach ($this->_content as $template => $content) {
|
||||
$this->assertContains(
|
||||
'<div id="cipherdata" class="hidden">' .
|
||||
htmlspecialchars(Helper::getPaste()['data'], ENT_NOQUOTES) .
|
||||
'</div>',
|
||||
$this->assertRegExp(
|
||||
'#<div[^>]+id="cipherdata"[^>]*>' .
|
||||
preg_quote(htmlspecialchars(Helper::getPaste()['data'], ENT_NOQUOTES)) .
|
||||
'</div>#',
|
||||
$content,
|
||||
$template . ': outputs data correctly'
|
||||
);
|
||||
|
@ -119,7 +119,7 @@ class ViewTest extends PHPUnit_Framework_TestCase
|
|||
$template . ': checked discussion if configured'
|
||||
);
|
||||
$this->assertRegExp(
|
||||
'#<[^>]+id="opendisc"[^>]*>#',
|
||||
'#<[^>]+id="opendiscussionoption"[^>]*>#',
|
||||
$content,
|
||||
$template . ': discussions available if configured'
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue