PHP Classes

File: tests/unit/Html/ATest.php

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

Contents

Class file image Download
<?php

class Html_ATest extends UnitTestCase
{

    public function
testConstructParams()
    {
       
$obj = new A_Html_A();
       
$this->assertEqual($obj->render(), '<a></a>');
       
$obj = new A_Html_A(array('href'=>'foo'));
       
$this->assertEqual($obj->render(), '<a href="foo"></a>');
       
$obj = new A_Html_A(array(), 'foobar');
       
$this->assertEqual($obj->render(), '<a>foobar</a>');
       
$obj = new A_Html_A(array('href'=>'foo'), 'foobar');
       
$this->assertEqual($obj->render(), '<a href="foo">foobar</a>');
    }
   
    public function
testRenderParams()
    {
        
$obj = new A_Html_A();
       
        
$this->assertEqual($obj->render(), '<a></a>');
       
$this->assertEqual($obj->render(array('href'=>'foo')), '<a href="foo"></a>');
       
$this->assertEqual($obj->render(array(), 'foobar'), '<a>foobar</a>');
       
$this->assertEqual($obj->render(array('href'=>'foo'), 'foobar'), '<a href="foo">foobar</a>');
    }
   
    public function
testStaticRenderParams()
    {
       
$this->assertEqual(A_Html_A::render(), '<a></a>');
       
$this->assertEqual(A_Html_A::render(array('href'=>'foo')), '<a href="foo"></a>');
       
$this->assertEqual(A_Html_A::render(array(), 'foobar'), '<a>foobar</a>');
       
$this->assertEqual(A_Html_A::render(array('href'=>'foo'), 'foobar'), '<a href="foo">foobar</a>');
    }
   
    public function
testMultiParams()
    {
       
$obj = new A_Html_A();
       
       
$this->assertEqual($obj->render(array('href'=>'http://example.com/','class'=>'sidebar'), 'foo'), '<a href="http://example.com/" class="sidebar">foo</a>');
    }
   
    public function
testHrefArgument()
    {
       
$obj = new A_Html_A();
       
       
$this->assertEqual($obj->render(array(), 'foo', 'http://example.com/'), '<a href="http://example.com/">foo</a>');
    }

}