493 |
ddelon |
1 |
<?php
|
|
|
2 |
// $Id: decorator_uri_test.php,v 1.1 2005-09-30 14:58:00 ddelon Exp $
|
|
|
3 |
|
|
|
4 |
require_once('simple_include.php');
|
|
|
5 |
require_once('calendar_include.php');
|
|
|
6 |
|
|
|
7 |
require_once('./decorator_test.php');
|
|
|
8 |
|
|
|
9 |
class TestOfDecoratorUri extends TestOfDecorator {
|
|
|
10 |
function TestOfDecoratorUri() {
|
|
|
11 |
$this->UnitTestCase('Test of Calendar_Decorator_Uri');
|
|
|
12 |
}
|
|
|
13 |
function testFragments() {
|
|
|
14 |
$Uri = new Calendar_Decorator_Uri($this->mockcal);
|
|
|
15 |
$Uri->setFragments('year','month','day','hour','minute','second');
|
|
|
16 |
$this->assertEqual('year=&month=&day=&hour=&minute=&second=',$Uri->this('second'));
|
|
|
17 |
}
|
|
|
18 |
function testScalarFragments() {
|
|
|
19 |
$Uri = new Calendar_Decorator_Uri($this->mockcal);
|
|
|
20 |
$Uri->setFragments('year','month','day','hour','minute','second');
|
|
|
21 |
$Uri->setScalar();
|
|
|
22 |
$this->assertEqual('&&&&&',$Uri->this('second'));
|
|
|
23 |
}
|
|
|
24 |
function testSetSeperator() {
|
|
|
25 |
$Uri = new Calendar_Decorator_Uri($this->mockcal);
|
|
|
26 |
$Uri->setFragments('year','month','day','hour','minute','second');
|
|
|
27 |
$Uri->setSeparator('/');
|
|
|
28 |
$this->assertEqual('year=/month=/day=/hour=/minute=/second=',$Uri->this('second'));
|
|
|
29 |
}
|
|
|
30 |
}
|
|
|
31 |
|
|
|
32 |
if (!defined('TEST_RUNNING')) {
|
|
|
33 |
define('TEST_RUNNING', true);
|
|
|
34 |
$test = &new TestOfDecoratorUri();
|
|
|
35 |
$test->run(new HtmlReporter());
|
|
|
36 |
}
|
|
|
37 |
?>
|