| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | $HOME = realpath(dirname(__FILE__)) . "/../../../.."; |
|---|
| 4 | // テスト用に定数を定義 |
|---|
| 5 | define('HTTP_URL', 'http://sample.eccube.jp/'); |
|---|
| 6 | define('HTTPS_URL', 'https://sample.eccube.jp/'); |
|---|
| 7 | require_once($HOME . "/tests/class/Common_TestCase.php"); |
|---|
| 8 | /* |
|---|
| 9 | * This file is part of EC-CUBE |
|---|
| 10 | * |
|---|
| 11 | * Copyright(c) 2000-2014 LOCKON CO.,LTD. All Rights Reserved. |
|---|
| 12 | * |
|---|
| 13 | * http://www.lockon.co.jp/ |
|---|
| 14 | * |
|---|
| 15 | * This program is free software; you can redistribute it and/or |
|---|
| 16 | * modify it under the terms of the GNU General Public License |
|---|
| 17 | * as published by the Free Software Foundation; either version 2 |
|---|
| 18 | * of the License, or (at your option) any later version. |
|---|
| 19 | * |
|---|
| 20 | * This program is distributed in the hope that it will be useful, |
|---|
| 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 23 | * GNU General Public License for more details. |
|---|
| 24 | * |
|---|
| 25 | * You should have received a copy of the GNU General Public License |
|---|
| 26 | * along with this program; if not, write to the Free Software |
|---|
| 27 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 28 | */ |
|---|
| 29 | |
|---|
| 30 | /** |
|---|
| 31 | * SC_Utils::isAppInnerUrl()のテストクラス. |
|---|
| 32 | * TODO まとめて実行する場合は定数の変更ができないためNG |
|---|
| 33 | * |
|---|
| 34 | * @author Hiroko Tamagawa |
|---|
| 35 | * @version $Id$ |
|---|
| 36 | */ |
|---|
| 37 | class SC_Utils_isAppInnerUrlTest extends Common_TestCase |
|---|
| 38 | { |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | protected function setUp() |
|---|
| 42 | { |
|---|
| 43 | // parent::setUp(); |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | protected function tearDown() |
|---|
| 47 | { |
|---|
| 48 | // parent::tearDown(); |
|---|
| 49 | } |
|---|
| 50 | |
|---|
| 51 | ///////////////////////////////////////// |
|---|
| 52 | /** |
|---|
| 53 | public function testIsAppInnerUrl_非SSLかつアプリ内URLの場合_trueが返る() |
|---|
| 54 | { |
|---|
| 55 | $input = 'http://sample.eccube.jp/admin/'; |
|---|
| 56 | $this->expected = true; |
|---|
| 57 | $this->actual = SC_Utils::isAppInnerUrl($input); |
|---|
| 58 | |
|---|
| 59 | $this->verify(); |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | public function testIsAppInnerUrl_非SSLかつアプリ外URLの場合_falseが返る() |
|---|
| 63 | { |
|---|
| 64 | $input = 'http://outside.eccube.jp/admin/'; |
|---|
| 65 | $this->expected = false; |
|---|
| 66 | $this->actual = SC_Utils::isAppInnerUrl($input); |
|---|
| 67 | |
|---|
| 68 | $this->verify(); |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | public function testIsAppInnerUrl_SSLかつアプリ内URLの場合_trueが返る() |
|---|
| 72 | { |
|---|
| 73 | $input = 'https://sample.eccube.jp/admin/'; |
|---|
| 74 | $this->expected = true; |
|---|
| 75 | $this->actual = SC_Utils::isAppInnerUrl($input); |
|---|
| 76 | |
|---|
| 77 | $this->verify(); |
|---|
| 78 | } |
|---|
| 79 | |
|---|
| 80 | public function testIsAppInnerUrl_SSLかつアプリ外URLの場合_falseが返る() |
|---|
| 81 | { |
|---|
| 82 | $input = 'https://outside.eccube.jp/admin/'; |
|---|
| 83 | $this->expected = false; |
|---|
| 84 | $this->actual = SC_Utils::isAppInnerUrl($input); |
|---|
| 85 | |
|---|
| 86 | $this->verify(); |
|---|
| 87 | } |
|---|
| 88 | */ |
|---|
| 89 | |
|---|
| 90 | ////////////////////////////////////////// |
|---|
| 91 | public function testDummyTest() { |
|---|
| 92 | // Warning が出るため空のテストを作成 |
|---|
| 93 | $this->assertTrue(true); |
|---|
| 94 | } |
|---|
| 95 | } |
|---|
| 96 | |
|---|