source: branches/version-2_5-dev/data/module/Calendar/tests/util_uri_test.php @ 20116

Revision 20116, 1.6 KB checked in by nanasess, 13 years ago (diff)
  • svn properties を再設定
  • 再設定用のスクリプト追加
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
1<?php
2// $Id$
3
4require_once('simple_include.php');
5require_once('calendar_include.php');
6
7Mock::generate('Calendar_Day','Mock_Calendar_Day');
8Mock::generate('Calendar_Engine_Interface','Mock_Calendar_Engine');
9
10class TestOfUtilUri extends UnitTestCase {
11
12    var $MockCal;
13   
14    function TestOfUtilUri() {
15        $this->UnitTestCase('Test of Calendar_Util_Uri');
16    }
17   
18    function setUp() {
19        $this->MockCal = & new Mock_Calendar_Day($this);
20        $this->MockCal->setReturnValue('getEngine',new Mock_Calendar_Engine($this));
21    }
22   
23    function testFragments() {
24        $Uri = new Calendar_Util_Uri('y','m','d','h','m','s');
25        $Uri->setFragments('year','month','day','hour','minute','second');
26        $this->assertEqual(
27            'year=&amp;month=&amp;day=&amp;hour=&amp;minute=&amp;second=',
28            $Uri->this($this->MockCal, 'second')
29        );
30    }
31    function testScalarFragments() {
32        $Uri = new Calendar_Util_Uri('year','month','day','hour','minute','second');
33        $Uri->scalar = true;
34        $this->assertEqual(
35            '&amp;&amp;&amp;&amp;&amp;',
36            $Uri->this($this->MockCal, 'second')
37        );
38    }
39    function testSetSeperator() {
40        $Uri = new Calendar_Util_Uri('year','month','day','hour','minute','second');
41        $Uri->separator = '/';
42        $this->assertEqual(
43            'year=/month=/day=/hour=/minute=/second=',
44            $Uri->this($this->MockCal, 'second')
45        );
46    }
47}
48
49if (!defined('TEST_RUNNING')) {
50    define('TEST_RUNNING', true);
51    $test = &new TestOfUtilUri();
52    $test->run(new HtmlReporter());
53}
54?>
Note: See TracBrowser for help on using the repository browser.