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:
El RIDO
2017-02-25 09:35:55 +01:00
parent e880f7924c
commit 131e08ca33
6 changed files with 241 additions and 221 deletions

View File

@@ -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'
);