PHP Classes

File: tests/unit/Html/Form/LabelTest.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   tests/unit/Html/Form/LabelTest.php   Download  
File: tests/unit/Html/Form/LabelTest.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Skeleton Framework
Extensive Web application development framework
Author: By
Last change:
Date: 8 years ago
Size: 1,524 bytes
 

Contents

Class file image Download
<?php

class Html_Form_LabelTest extends UnitTestCase {
   
    function
setUp() {
    }
   
    function
TearDown() {
    }
   
    function
testHtml_Form_LabelObjConstructParams() {
       
       
$obj = new A_Html_Form_Label();
       
$this->assertEqual($obj->render(), '<label></label>');
       
$obj = new A_Html_Form_Label(array('for'=>'foo'));
       
$this->assertEqual($obj->render(), '<label for="foo"></label>');
       
$obj = new A_Html_Form_Label(array(), 'foobar');
       
$this->assertEqual($obj->render(), '<label>foobar</label>');
       
$obj = new A_Html_Form_Label(array('for'=>'foo'), 'foobar');
       
$this->assertEqual($obj->render(), '<label for="foo">foobar</label>');
    }
   
    function
testHtml_Form_LabelObjRenderParams() {
        
$obj = new A_Html_Form_Label();

        
$this->assertEqual($obj->render(), '<label></label>');
       
$this->assertEqual($obj->render(array('for'=>'foo')), '<label for="foo"></label>');
       
$this->assertEqual($obj->render(array(), 'foobar'), '<label>foobar</label>');
       
$this->assertEqual($obj->render(array('for'=>'foo'), 'foobar'), '<label for="foo">foobar</label>');
    }
   
    function
testHtml_Form_LabelStaticRenderParams() {
       
$this->assertEqual(A_Html_Form_Label::render(), '<label></label>');
       
$this->assertEqual(A_Html_Form_Label::render(array('for'=>'foo')), '<label for="foo"></label>');
       
$this->assertEqual(A_Html_Form_Label::render(array(), 'foobar'), '<label>foobar</label>');
       
$this->assertEqual(A_Html_Form_Label::render(array('for'=>'foo'), 'foobar'), '<label for="foo">foobar</label>');
    }
       
}