Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
.
namespace core;
use xhtml_container_stack;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->libdir . '/outputlib.php');
/**
* Unit tests for the xhtml_container_stack class.
*
* These tests assume that developer debug mode is on which is enforced by our phpunit integration.
*
* @package core
* @category test
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class xhtml_container_stack_test extends \advanced_testcase {
public function test_push_then_pop() {
// Set up.
$stack = new xhtml_container_stack();
// Exercise SUT.
$stack->push('testtype', '');
$html = $stack->pop('testtype');
// Verify outcome.
$this->assertEquals('', $html);
$this->assertDebuggingNotCalled();
}
public function test_mismatched_pop_prints_warning() {
// Set up.
$stack = new xhtml_container_stack();
$stack->push('testtype', '');
// Exercise SUT.
$html = $stack->pop('mismatch');
// Verify outcome.
$this->assertEquals('', $html);
$this->assertDebuggingCalled();
}
public function test_pop_when_empty_prints_warning() {
// Set up.
$stack = new xhtml_container_stack();
// Exercise SUT.
$html = $stack->pop('testtype');
// Verify outcome.
$this->assertEquals('', $html);
$this->assertDebuggingCalled();
}
public function test_correct_nesting() {
// Set up.
$stack = new xhtml_container_stack();
// Exercise SUT.
$stack->push('testdiv', '');
$stack->push('testp', '');
$html2 = $stack->pop('testp');
$html1 = $stack->pop('testdiv');
// Verify outcome.
$this->assertEquals('', $html2);
$this->assertEquals('', $html1);
$this->assertDebuggingNotCalled();
}
public function test_pop_all_but_last() {
// Set up.
$stack = new xhtml_container_stack();
$stack->push('test1', '');
$stack->push('test2', '');
$stack->push('test3', '');
// Exercise SUT.
$html = $stack->pop_all_but_last();
// Verify outcome.
$this->assertEquals('', $html);
$this->assertDebuggingNotCalled();
// Tear down.
$stack->discard();
}
public function test_pop_all_but_last_only_one() {
// Set up.
$stack = new xhtml_container_stack();
$stack->push('test1', '');
// Exercise SUT.
$html = $stack->pop_all_but_last();
// Verify outcome.
$this->assertEquals('', $html);
$this->assertDebuggingNotCalled();
// Tear down.
$stack->discard();
}
public function test_pop_all_but_last_empty() {
// Set up.
$stack = new xhtml_container_stack();
// Exercise SUT.
$html = $stack->pop_all_but_last();
// Verify outcome.
$this->assertEquals('', $html);
$this->assertDebuggingNotCalled();
}
public function test_discard() {
// Set up.
$stack = new xhtml_container_stack();
$stack->push('test1', '');
$stack->discard();
// Exercise SUT.
$stack = null;
// Verify outcome.
$this->assertDebuggingNotCalled();
}
}