Example #1
0
 public function test_correct_nesting() {
     // Set up.
     $stack = new xhtml_container_stack();
     // Exercise SUT.
     $stack->push('testdiv', '</div>');
     $stack->push('testp', '</p>');
     $html2 = $stack->pop('testp');
     $html1 = $stack->pop('testdiv');
     // Verify outcome
     $this->assertEquals('</p>', $html2);
     $this->assertEquals('</div>', $html1);
     $this->assertDebuggingNotCalled();
 }
 public function test_correct_nesting()
 {
     // Set up.
     $stack = new xhtml_container_stack();
     // Exercise SUT.
     $this->start_capture();
     $stack->push('testdiv', '</div>');
     $stack->push('testp', '</p>');
     $html2 = $stack->pop('testp');
     $html1 = $stack->pop('testdiv');
     $errors = $this->end_capture();
     // Verify outcome
     $this->assertEquals('</p>', $html2);
     $this->assertEquals('</div>', $html1);
     $this->assertEquals('', $errors);
 }