- Timestamp:
- 2009/07/20 18:21:51 (15 years ago)
- Location:
- branches/comu-ver2/test
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/test/TestSuite.php
r16582 r18218 1 #!/usr/local/bin/php2 1 <?php 3 2 /* 4 3 * This file is part of EC-CUBE 5 4 * 6 * Copyright(c) 2000-200 7LOCKON CO.,LTD. All Rights Reserved.5 * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved. 7 6 * 8 7 * http://www.lockon.co.jp/ … … 23 22 */ 24 23 25 ini_set("include_path", ".:/usr/local/share/pear");26 24 // {{{ requires 27 25 require_once("../html/require.php"); 28 require_once("class/page/LC_Page_Test.php"); 29 require_once("class/db/SC_DB_DBFactory_Test.php"); 30 require_once("class/db/SC_DB_MasterData_Test.php"); 31 require_once("class/helper/SC_Helper_DB_Test.php"); 32 require_once("PHPUnit.php"); 26 require_once("class/page/Page_AllTests.php"); 27 require_once("class/db/DB_AllTests.php"); 28 require_once("class/helper/Helper_AllTests.php"); 29 require_once("PHPUnit/Framework.php"); 33 30 34 $suites = array(); 35 $suites[0] = new PHPUnit_TestSuite("LC_Page_Test"); 36 $suites[1] = new PHPUnit_TestSuite("SC_DB_DBFactory_Test"); 37 $suites[2] = new PHPUnit_TestSuite("SC_DB_MasterData_Test"); 38 $suites[3] = new PHPUnit_TestSuite("SC_Helper_DB_Test"); 31 /** 32 * EC-CUBE のテストスイート 33 * 34 * @author Kentaro Ohkouchi 35 * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $ 36 */ 39 37 40 foreach ($suites as $suite) { 41 $result = PHPUnit::run($suite); 42 print $result->toString(); 38 class TestSuite { 39 public static function suite() { 40 $suite = new PHPUnit_Framework_TestSuite('ECCUBE'); 41 $suite->addTest(Page_AllTests::suite()); 42 $suite->addTest(DB_AllTests::suite()); 43 $suite->addTest(Helper_AllTests::suite()); 44 return $suite; 45 } 43 46 } 44 47 ?> -
branches/comu-ver2/test/class/db/SC_DB_DBFactory_Test.php
r16582 r18218 3 3 * This file is part of EC-CUBE 4 4 * 5 * Copyright(c) 2000-200 7LOCKON CO.,LTD. All Rights Reserved.5 * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved. 6 6 * 7 7 * http://www.lockon.co.jp/ … … 23 23 24 24 // {{{ requires 25 require_once($include_dir . "/../data/class/db_extends/SC_DB_DBFactory_Ex.php"); // FIXME 26 require_once("PHPUnit/TestCase.php"); 25 require_once("../html/require.php"); 26 require_once("../data/class_extends/db_extends/SC_DB_DBFactory_Ex.php"); 27 require_once("PHPUnit/Framework.php"); 27 28 28 29 /** … … 33 34 * @version $Id:SC_DB_DBFactory_Test.php 15532 2007-08-31 14:39:46Z nanasess $ 34 35 */ 35 class SC_DB_DBFactory_Test extends PHPUnit_ TestCase {36 class SC_DB_DBFactory_Test extends PHPUnit_Framework_TestCase { 36 37 37 38 // }}} -
branches/comu-ver2/test/class/db/SC_DB_MasterData_Test.php
r16582 r18218 3 3 * This file is part of EC-CUBE 4 4 * 5 * Copyright(c) 2000-200 7LOCKON CO.,LTD. All Rights Reserved.5 * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved. 6 6 * 7 7 * http://www.lockon.co.jp/ … … 23 23 24 24 // {{{ requires 25 require_once(CLASS_EX_PATH . "db_extends/SC_DB_MasterData_Ex.php"); 26 require_once("PHPUnit/TestCase.php"); 25 require_once("../html/require.php"); 26 require_once("../data/class_extends/db_extends/SC_DB_MasterData_Ex.php"); 27 require_once("PHPUnit/Framework.php"); 27 28 28 29 /** … … 33 34 * @version $Id:SC_DB_MasterData_Test.php 15532 2007-08-31 14:39:46Z nanasess $ 34 35 */ 35 class SC_DB_MasterData_Test extends PHPUnit_ TestCase {36 class SC_DB_MasterData_Test extends PHPUnit_Framework_TestCase { 36 37 37 38 // }}} -
branches/comu-ver2/test/class/helper/SC_Helper_DB_Test.php
r16582 r18218 3 3 * This file is part of EC-CUBE 4 4 * 5 * Copyright(c) 2000-200 7LOCKON CO.,LTD. All Rights Reserved.5 * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved. 6 6 * 7 7 * http://www.lockon.co.jp/ … … 23 23 24 24 // {{{ requires 25 // {{{ requires 26 require_once($include_dir . "/../data/class/helper_extends/SC_Helper_DB_Ex.php"); // FIXME 27 require_once("PHPUnit/TestCase.php"); 28 25 require_once("../html/require.php"); 26 require_once("../data/class_extends/helper_extends/SC_Helper_DB_Ex.php"); 27 require_once("PHPUnit/Framework.php"); 29 28 30 29 /** … … 35 34 * @version $Id$ 36 35 */ 37 class SC_Helper_DB_Test extends PHPUnit_ TestCase {36 class SC_Helper_DB_Test extends PHPUnit_Framework_TestCase { 38 37 39 38 /** … … 55 54 function testSfIndexExists() { 56 55 $objDb = new SC_Helper_DB_Ex(); 57 $this->assertEquals(true, $objDb->sfIndexExists("dtb_products", "category_id", 58 "dtb_products_category_id_key")); 56 $this->assertEquals(true, $objDb->sfIndexExists("dtb_products", 57 "product_id", 58 "dtb_products_pkey")); 59 59 } 60 60 } -
branches/comu-ver2/test/class/page/LC_Page_Test.php
r16582 r18218 3 3 * This file is part of EC-CUBE 4 4 * 5 * Copyright(c) 2000-200 7LOCKON CO.,LTD. All Rights Reserved.5 * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved. 6 6 * 7 7 * http://www.lockon.co.jp/ … … 23 23 24 24 // {{{ requires 25 require_once(CLASS_PATH . "pages/LC_Page.php"); 26 require_once("PHPUnit/TestCase.php"); 25 require_once("../html/require.php"); 26 require_once("../data/class/pages/LC_Page.php"); 27 require_once("PHPUnit/Framework.php"); 27 28 28 29 /** … … 33 34 * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $ 34 35 */ 35 class LC_Page_Test extends PHPUnit_ TestCase {36 class LC_Page_Test extends PHPUnit_Framework_TestCase { 36 37 37 38 // }}} 38 39 // {{{ functions 39 40 41 /* 42 * FIXME LC_Page::sendRedirect() は, リダイレクトしてしまうため, 43 * PHPUnit3 ではテストできない... 44 */ 45 40 46 /** 41 47 * LC_Page::sendRedirect() のテストケース(エラー). 42 48 */ 49 /* 43 50 function testSendRedirect() { 44 51 $objPage = new LC_Page(); … … 47 54 $this->assertEquals(true, empty($result)); 48 55 } 49 56 */ 50 57 /** 51 58 * LC_Page::sendRedirect() のテストケース(エラー). 52 59 */ 60 /* 53 61 function testSendRedirectIsFailed() { 54 62 $objPage = new LC_Page(); … … 57 65 $this->assertEquals(false, $result); 58 66 } 67 */ 59 68 60 69 /** … … 132 141 function testGetLocation() { 133 142 $objPage = new LC_Page(); 134 $_SERVER['DOCUMENT_ROOT'] = realpath("../ ../../html");135 $url = $objPage->getLocation("../ ../../html/abouts/index.php");143 $_SERVER['DOCUMENT_ROOT'] = realpath("../html"); 144 $url = $objPage->getLocation("../html/abouts/index.php"); 136 145 137 146 $this->assertEquals(SITE_URL . "abouts/index.php", $url); … … 160 169 function testGetLocationWithQueryString() { 161 170 $objPage = new LC_Page(); 162 $_SERVER['DOCUMENT_ROOT'] = realpath("../ ../../html");171 $_SERVER['DOCUMENT_ROOT'] = realpath("../html"); 163 172 164 173 $queryString = array("mode" => "update", "type" => "text"); 165 $url = $objPage->getLocation("../ ../../html/abouts/index.php", $queryString);174 $url = $objPage->getLocation("../html/abouts/index.php", $queryString); 166 175 167 176 $this->assertEquals(SITE_URL . "abouts/index.php?mode=update&type=text", $url); … … 176 185 function testGetLocationUseSSL() { 177 186 $objPage = new LC_Page(); 178 $_SERVER['DOCUMENT_ROOT'] = realpath("../ ../../html");187 $_SERVER['DOCUMENT_ROOT'] = realpath("../html"); 179 188 180 189 $queryString = array("mode" => "update", "type" => "text"); 181 $url = $objPage->getLocation("../ ../../html/abouts/index.php", $queryString, true);190 $url = $objPage->getLocation("../html/abouts/index.php", $queryString, true); 182 191 183 192 $this->assertEquals(SSL_URL . "abouts/index.php?mode=update&type=text", $url); … … 192 201 function testGetLocationWithDocumentRoot() { 193 202 $objPage = new LC_Page(); 194 $documentRoot = realpath("../ ../../html");203 $documentRoot = realpath("../html"); 195 204 196 205 $queryString = array("mode" => "update", "type" => "text"); 197 $url = $objPage->getLocation("../ ../../html/abouts/index.php", array(),206 $url = $objPage->getLocation("../html/abouts/index.php", array(), 198 207 false, $documentRoot); 199 208
Note: See TracChangeset
for help on using the changeset viewer.