芝麻web文件管理V1.00
');
$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();
}
}