PHP Classes

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

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   tests/unit/Html/Form/TextareaTest.php   Download  
File: tests/unit/Html/Form/TextareaTest.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,647 bytes
 

Contents

Class file image Download
<?php

class Html_Form_TextareaTest extends UnitTestCase {
   
    function
setUp() {
    }
   
    function
TearDown() {
    }
   
    function
testHtml_Form_TextareaObjConstructParams() {
       
       
$obj = new A_Html_Form_Textarea();
       
$this->assertEqual($obj->render(), '<textarea></textarea>');
       
$obj = new A_Html_Form_Textarea(array('name'=>'foo'));
       
$this->assertEqual($obj->render(), '<textarea name="foo"></textarea>');
       
$obj = new A_Html_Form_Textarea(array(), 'foobar');
       
$this->assertEqual($obj->render(), '<textarea>foobar</textarea>');
       
$obj = new A_Html_Form_Textarea(array('name'=>'foo'), 'foobar');
       
$this->assertEqual($obj->render(), '<textarea name="foo">foobar</textarea>');
    }
   
    function
testHtml_Form_TextareaObjRenderParams() {
        
$obj = new A_Html_Form_Textarea();

        
$this->assertEqual($obj->render(), '<textarea></textarea>');
       
$this->assertEqual($obj->render(array('name'=>'foo')), '<textarea name="foo"></textarea>');
       
$this->assertEqual($obj->render(array(), 'foobar'), '<textarea>foobar</textarea>');
       
$this->assertEqual($obj->render(array('name'=>'foo'), 'foobar'), '<textarea name="foo">foobar</textarea>');
    }
   
    function
testHtml_Form_TextareaStaticRenderParams() {
       
$this->assertEqual(A_Html_Form_Textarea::render(), '<textarea></textarea>');
       
$this->assertEqual(A_Html_Form_Textarea::render(array('name'=>'foo')), '<textarea name="foo"></textarea>');
       
$this->assertEqual(A_Html_Form_Textarea::render(array(), 'foobar'), '<textarea>foobar</textarea>');
       
$this->assertEqual(A_Html_Form_Textarea::render(array('name'=>'foo'), 'foobar'), '<textarea name="foo">foobar</textarea>');
    }
   
    }