1 | <?php |
---|
2 | /* |
---|
3 | * This file is part of EC-CUBE |
---|
4 | * |
---|
5 | * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved. |
---|
6 | * |
---|
7 | * http://www.lockon.co.jp/ |
---|
8 | * |
---|
9 | * This program is free software; you can redistribute it and/or |
---|
10 | * modify it under the terms of the GNU General Public License |
---|
11 | * as published by the Free Software Foundation; either version 2 |
---|
12 | * of the License, or (at your option) any later version. |
---|
13 | * |
---|
14 | * This program is distributed in the hope that it will be useful, |
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | * GNU General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with this program; if not, write to the Free Software |
---|
21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
22 | */ |
---|
23 | |
---|
24 | // {{{ requires |
---|
25 | require_once("../html/require.php"); |
---|
26 | require_once("../data/class/pages/LC_Page.php"); |
---|
27 | require_once("PHPUnit/Framework.php"); |
---|
28 | |
---|
29 | /** |
---|
30 | * SC_Utils のテストケース. |
---|
31 | * |
---|
32 | * @package Page |
---|
33 | * @author LOCKON CO.,LTD. |
---|
34 | * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $ |
---|
35 | */ |
---|
36 | class SC_Utils_Test extends PHPUnit_Framework_TestCase { |
---|
37 | |
---|
38 | // }}} |
---|
39 | // {{{ functions |
---|
40 | |
---|
41 | /** |
---|
42 | * SC_Utils::getRealURL() のテストケース. |
---|
43 | * |
---|
44 | * 変換無し |
---|
45 | */ |
---|
46 | function testGetRealURL_変換無し() { |
---|
47 | $url = "http://www.example.jp/admin/index.php"; |
---|
48 | |
---|
49 | $expected = "http://www.example.jp/admin/index.php"; |
---|
50 | $actual = SC_Utils::getRealURL($url); |
---|
51 | |
---|
52 | $this->assertEquals($expected, $actual); |
---|
53 | } |
---|
54 | |
---|
55 | function testGetRealURL_変換有() { |
---|
56 | $url = "http://www.example.jp/admin/../index.php"; |
---|
57 | |
---|
58 | $expected = "http://www.example.jp/index.php"; |
---|
59 | $actual = SC_Utils::getRealURL($url); |
---|
60 | |
---|
61 | $this->assertEquals($expected, $actual); |
---|
62 | } |
---|
63 | |
---|
64 | function testGetRealURL_空のディレクトリ() { |
---|
65 | $url = "http://www.example.jp/admin/..///index.php"; |
---|
66 | |
---|
67 | $expected = "http://www.example.jp/index.php"; |
---|
68 | $actual = SC_Utils::getRealURL($url); |
---|
69 | |
---|
70 | $this->assertEquals($expected, $actual); |
---|
71 | } |
---|
72 | |
---|
73 | function testGetRealURL_Dotのディレクトリ() { |
---|
74 | $url = "http://www.example.jp/admin/././../index.php"; |
---|
75 | |
---|
76 | $expected = "http://www.example.jp/index.php"; |
---|
77 | $actual = SC_Utils::getRealURL($url); |
---|
78 | |
---|
79 | $this->assertEquals($expected, $actual); |
---|
80 | } |
---|
81 | } |
---|
82 | ?> |
---|