PHP Classes

File: tests/unit/Pagination/Helper/UrlTest.php

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

Contents

Class file image Download
<?php

class Pagination_Helper_UrlTest extends UnitTestCase {

    public function
setUp() {
       
$this->url = new A_Pagination_Helper_Url ('forums.devnetwork.net/page.php', 'http');
    }

    public function
testSingleSetParameter() {
       
$this->url->set('order', 'title');
       
$this->assertEqual ($this->url->render (), 'http://forums.devnetwork.net/page.php?order=title');
    }

    public function
testDoubleSetParameter() {
       
$this->url->set ('order', 'title');
       
$this->url->set ('pageSize', '5');
       
$this->assertEqual ($this->url->render (), 'http://forums.devnetwork.net/page.php?order=title&pageSize=5');
    }

    public function
testDoubleSetParameterWithBuildParameter() {
       
$this->url->set ('order', 'title');
       
$this->url->set ('pageSize', '5');
       
$this->assertEqual ($this->url->render ('', array ('page' => 2)), 'http://forums.devnetwork.net/page.php?order=title&pageSize=5&page=2');
    }

    public function
testSetBase() {
       
$this->url->setBase ('www.devnetwork.net');
       
$this->assertEqual ($this->url->render (), 'http://www.devnetwork.net');
    }

    public function
testSetBaseParam() {
       
$this->assertEqual ($this->url->render ('page.php'), 'page.php');
    }

    public function
testSetProtocol() {
       
$this->url->setProtocol ('https');
       
$this->assertEqual ($this->url->render (), 'https://forums.devnetwork.net/page.php');
    }

}