Index: branches/comu-ver2/test/TestSuite.php
===================================================================
--- branches/comu-ver2/test/TestSuite.php	(revision 16582)
+++ branches/comu-ver2/test/TestSuite.php	(revision 18218)
@@ -1,8 +1,7 @@
-#!/usr/local/bin/php
 <?php
 /*
  * This file is part of EC-CUBE
  *
- * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
+ * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved.
  *
  * http://www.lockon.co.jp/
@@ -23,22 +22,26 @@
  */
 
-ini_set("include_path", ".:/usr/local/share/pear");
 // {{{ requires
 require_once("../html/require.php");
-require_once("class/page/LC_Page_Test.php");
-require_once("class/db/SC_DB_DBFactory_Test.php");
-require_once("class/db/SC_DB_MasterData_Test.php");
-require_once("class/helper/SC_Helper_DB_Test.php");
-require_once("PHPUnit.php");
+require_once("class/page/Page_AllTests.php");
+require_once("class/db/DB_AllTests.php");
+require_once("class/helper/Helper_AllTests.php");
+require_once("PHPUnit/Framework.php");
 
-$suites = array();
-$suites[0] = new PHPUnit_TestSuite("LC_Page_Test");
-$suites[1] = new PHPUnit_TestSuite("SC_DB_DBFactory_Test");
-$suites[2] = new PHPUnit_TestSuite("SC_DB_MasterData_Test");
-$suites[3] = new PHPUnit_TestSuite("SC_Helper_DB_Test");
+/**
+ * EC-CUBE のテストスイート
+ *
+ * @author Kentaro Ohkouchi
+ * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $
+ */
 
-foreach ($suites as $suite) {
-    $result = PHPUnit::run($suite);
-    print $result->toString();
+class TestSuite {
+    public static function suite() {
+        $suite = new PHPUnit_Framework_TestSuite('ECCUBE');
+        $suite->addTest(Page_AllTests::suite());
+        $suite->addTest(DB_AllTests::suite());
+        $suite->addTest(Helper_AllTests::suite());
+        return $suite;
+    }
 }
 ?>
Index: branches/comu-ver2/test/class/page/Page_AllTests.php
===================================================================
--- branches/comu-ver2/test/class/page/Page_AllTests.php	(revision 18218)
+++ branches/comu-ver2/test/class/page/Page_AllTests.php	(revision 18218)
@@ -0,0 +1,44 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once 'PHPUnit/Framework.php';
+
+require_once 'LC_Page_Test.php';
+
+/**
+ * Page パッケージのテストケース.
+ *
+ * @package Page
+ * @author Kentaro Ohkouchi
+ * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $
+ */
+class Page_AllTests extends PHPUnit_Framework_TestCase {
+
+    public static function suite() {
+        $suite = new PHPUnit_Framework_TestSuite('Page');
+        $suite->addTestSuite('LC_Page_Test');
+        return $suite;
+    }
+}
+?>
Index: branches/comu-ver2/test/class/page/LC_Page_Test.php
===================================================================
--- branches/comu-ver2/test/class/page/LC_Page_Test.php	(revision 16582)
+++ branches/comu-ver2/test/class/page/LC_Page_Test.php	(revision 18218)
@@ -3,5 +3,5 @@
  * This file is part of EC-CUBE
  *
- * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
+ * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved.
  *
  * http://www.lockon.co.jp/
@@ -23,6 +23,7 @@
 
 // {{{ requires
-require_once(CLASS_PATH . "pages/LC_Page.php");
-require_once("PHPUnit/TestCase.php");
+require_once("../html/require.php");
+require_once("../data/class/pages/LC_Page.php");
+require_once("PHPUnit/Framework.php");
 
 /**
@@ -33,12 +34,18 @@
  * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $
  */
-class LC_Page_Test extends PHPUnit_TestCase {
+class LC_Page_Test extends PHPUnit_Framework_TestCase {
 
     // }}}
     // {{{ functions
 
+    /*
+     * FIXME LC_Page::sendRedirect() は, リダイレクトしてしまうため,
+     *       PHPUnit3 ではテストできない...
+     */
+
     /**
      * LC_Page::sendRedirect() のテストケース(エラー).
      */
+    /*
     function testSendRedirect() {
         $objPage = new LC_Page();
@@ -47,8 +54,9 @@
         $this->assertEquals(true, empty($result));
     }
-
+    */
     /**
      * LC_Page::sendRedirect() のテストケース(エラー).
      */
+    /*
     function testSendRedirectIsFailed() {
         $objPage = new LC_Page();
@@ -57,4 +65,5 @@
         $this->assertEquals(false, $result);
     }
+    */
 
     /**
@@ -132,6 +141,6 @@
     function testGetLocation() {
         $objPage = new LC_Page();
-        $_SERVER['DOCUMENT_ROOT'] = realpath("../../../html");
-        $url = $objPage->getLocation("../../../html/abouts/index.php");
+        $_SERVER['DOCUMENT_ROOT'] = realpath("../html");
+        $url = $objPage->getLocation("../html/abouts/index.php");
 
         $this->assertEquals(SITE_URL . "abouts/index.php", $url);
@@ -160,8 +169,8 @@
     function testGetLocationWithQueryString() {
         $objPage = new LC_Page();
-        $_SERVER['DOCUMENT_ROOT'] = realpath("../../../html");
+        $_SERVER['DOCUMENT_ROOT'] = realpath("../html");
 
         $queryString = array("mode" => "update", "type" => "text");
-        $url = $objPage->getLocation("../../../html/abouts/index.php", $queryString);
+        $url = $objPage->getLocation("../html/abouts/index.php", $queryString);
 
         $this->assertEquals(SITE_URL . "abouts/index.php?mode=update&type=text", $url);
@@ -176,8 +185,8 @@
     function testGetLocationUseSSL() {
         $objPage = new LC_Page();
-        $_SERVER['DOCUMENT_ROOT'] = realpath("../../../html");
+        $_SERVER['DOCUMENT_ROOT'] = realpath("../html");
 
         $queryString = array("mode" => "update", "type" => "text");
-        $url = $objPage->getLocation("../../../html/abouts/index.php", $queryString, true);
+        $url = $objPage->getLocation("../html/abouts/index.php", $queryString, true);
 
         $this->assertEquals(SSL_URL . "abouts/index.php?mode=update&type=text", $url);
@@ -192,8 +201,8 @@
     function testGetLocationWithDocumentRoot() {
         $objPage = new LC_Page();
-        $documentRoot = realpath("../../../html");
+        $documentRoot = realpath("../html");
 
         $queryString = array("mode" => "update", "type" => "text");
-        $url = $objPage->getLocation("../../../html/abouts/index.php", array(),
+        $url = $objPage->getLocation("../html/abouts/index.php", array(),
                                      false, $documentRoot);
 
Index: branches/comu-ver2/test/class/helper/SC_Helper_DB_Test.php
===================================================================
--- branches/comu-ver2/test/class/helper/SC_Helper_DB_Test.php	(revision 16582)
+++ branches/comu-ver2/test/class/helper/SC_Helper_DB_Test.php	(revision 18218)
@@ -3,5 +3,5 @@
  * This file is part of EC-CUBE
  *
- * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
+ * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved.
  *
  * http://www.lockon.co.jp/
@@ -23,8 +23,7 @@
 
 // {{{ requires
-// {{{ requires
-require_once($include_dir . "/../data/class/helper_extends/SC_Helper_DB_Ex.php"); // FIXME
-require_once("PHPUnit/TestCase.php");
-
+require_once("../html/require.php");
+require_once("../data/class_extends/helper_extends/SC_Helper_DB_Ex.php");
+require_once("PHPUnit/Framework.php");
 
 /**
@@ -35,5 +34,5 @@
  * @version $Id$
  */
-class SC_Helper_DB_Test extends PHPUnit_TestCase {
+class SC_Helper_DB_Test extends PHPUnit_Framework_TestCase {
 
     /**
@@ -55,6 +54,7 @@
     function testSfIndexExists() {
         $objDb = new SC_Helper_DB_Ex();
-        $this->assertEquals(true, $objDb->sfIndexExists("dtb_products", "category_id",
-                "dtb_products_category_id_key"));
+        $this->assertEquals(true, $objDb->sfIndexExists("dtb_products",
+                                                        "product_id",
+                                                        "dtb_products_pkey"));
     }
 }
Index: branches/comu-ver2/test/class/helper/Helper_AllTests.php
===================================================================
--- branches/comu-ver2/test/class/helper/Helper_AllTests.php	(revision 18218)
+++ branches/comu-ver2/test/class/helper/Helper_AllTests.php	(revision 18218)
@@ -0,0 +1,44 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once 'PHPUnit/Framework.php';
+
+require_once 'SC_Helper_DB_Test.php';
+
+/**
+ * Helper パッケージのテストケース.
+ *
+ * @package DB
+ * @author Kentaro Ohkouchi
+ * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $
+ */
+class Helper_AllTests extends PHPUnit_Framework_TestCase {
+
+    public static function suite() {
+        $suite = new PHPUnit_Framework_TestSuite('SC_Helper');
+        $suite->addTestSuite('SC_Helper_DB_Test');
+        return $suite;
+    }
+}
+?>
Index: branches/comu-ver2/test/class/db/SC_DB_MasterData_Test.php
===================================================================
--- branches/comu-ver2/test/class/db/SC_DB_MasterData_Test.php	(revision 16582)
+++ branches/comu-ver2/test/class/db/SC_DB_MasterData_Test.php	(revision 18218)
@@ -3,5 +3,5 @@
  * This file is part of EC-CUBE
  *
- * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
+ * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved.
  *
  * http://www.lockon.co.jp/
@@ -23,6 +23,7 @@
 
 // {{{ requires
-require_once(CLASS_EX_PATH . "db_extends/SC_DB_MasterData_Ex.php");
-require_once("PHPUnit/TestCase.php");
+require_once("../html/require.php");
+require_once("../data/class_extends/db_extends/SC_DB_MasterData_Ex.php");
+require_once("PHPUnit/Framework.php");
 
 /**
@@ -33,5 +34,5 @@
  * @version $Id:SC_DB_MasterData_Test.php 15532 2007-08-31 14:39:46Z nanasess $
  */
-class SC_DB_MasterData_Test extends PHPUnit_TestCase {
+class SC_DB_MasterData_Test extends PHPUnit_Framework_TestCase {
 
     // }}}
Index: branches/comu-ver2/test/class/db/DB_AllTests.php
===================================================================
--- branches/comu-ver2/test/class/db/DB_AllTests.php	(revision 18218)
+++ branches/comu-ver2/test/class/db/DB_AllTests.php	(revision 18218)
@@ -0,0 +1,46 @@
+<?php
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+// {{{ requires
+require_once 'PHPUnit/Framework.php';
+
+require_once 'SC_DB_DBFactory_Test.php';
+require_once 'SC_DB_MasterData_Test.php';
+
+/**
+ * DB パッケージのテストケース.
+ *
+ * @package DB
+ * @author Kentaro Ohkouchi
+ * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $
+ */
+class DB_AllTests extends PHPUnit_Framework_TestCase {
+
+    public static function suite() {
+        $suite = new PHPUnit_Framework_TestSuite('SC_DB');
+        $suite->addTestSuite('SC_DB_DBFactory_Test');
+        $suite->addTestSuite('SC_DB_MasterData_Test');
+        return $suite;
+    }
+}
+?>
Index: branches/comu-ver2/test/class/db/SC_DB_DBFactory_Test.php
===================================================================
--- branches/comu-ver2/test/class/db/SC_DB_DBFactory_Test.php	(revision 16582)
+++ branches/comu-ver2/test/class/db/SC_DB_DBFactory_Test.php	(revision 18218)
@@ -3,5 +3,5 @@
  * This file is part of EC-CUBE
  *
- * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
+ * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved.
  *
  * http://www.lockon.co.jp/
@@ -23,6 +23,7 @@
 
 // {{{ requires
-require_once($include_dir . "/../data/class/db_extends/SC_DB_DBFactory_Ex.php"); // FIXME
-require_once("PHPUnit/TestCase.php");
+require_once("../html/require.php");
+require_once("../data/class_extends/db_extends/SC_DB_DBFactory_Ex.php");
+require_once("PHPUnit/Framework.php");
 
 /**
@@ -33,5 +34,5 @@
  * @version $Id:SC_DB_DBFactory_Test.php 15532 2007-08-31 14:39:46Z nanasess $
  */
-class SC_DB_DBFactory_Test extends PHPUnit_TestCase {
+class SC_DB_DBFactory_Test extends PHPUnit_Framework_TestCase {
 
     // }}}
Index: branches/comu-ver2/test/README.txt
===================================================================
--- branches/comu-ver2/test/README.txt	(revision 18218)
+++ branches/comu-ver2/test/README.txt	(revision 18218)
@@ -0,0 +1,80 @@
+                    PHPUnit を使用したテストケースについて
+                 ____________________________________________
+
+	EC-CUBE では, PHPUnit を使用して, テスト駆動開発が可能です.
+	このドキュメントは, PHPUnit の使用方法を説明します.
+
+
+1. PHPUnit について
+-------------------
+
+	PHPUnit
+	http://www.phpunit.de/
+
+	日本語マニュアル
+	http://www.phpunit.de/manual/3.3/ja/index.html
+
+	PHPUnit3.3.x を使用してテストを行います.
+	残念ながら, このバージョンでは PHP4 はサポートされません.
+
+2. 動作環境
+-----------
+
+	http://www.phpunit.de/wiki/Requirements
+
+3. インストール
+---------------
+
+	http://www.phpunit.de/manual/3.3/ja/installation.html
+
+4. 実行方法
+-----------
+
+	テストケースで, EC-CUBE 本体のクラスへアクセスする時に相対パスを
+ 	使用していますので, 必ず test ディレクトリから実行して下さい.
+	また, EC-CUBE のクラス名は, PHPUnit の規約に沿ってないため, 引数で
+	PHPファイルを指定する必要があります.
+
+	
+	すべてのテストを実行するとき
+
+	  TestSuite クラスを実行します.
+          ------------------------------------------------------------
+	  $ phpunit TestSuite TestSuite.php
+	  PHPUnit 3.3.17 by Sebastian Bergmann.
+
+	  .................
+
+	  Time: 0 seconds
+
+	  OK (17 tests, 20 assertions)
+          ------------------------------------------------------------
+
+	パッケージごとにテストを実行するとき
+
+	  Package_AllTests クラスを実行します.
+          ------------------------------------------------------------
+	  $ phpunit DB_AllTests class/db/DB_AllTests.php
+	  PHPUnit 3.3.17 by Sebastian Bergmann.
+
+	  ....
+
+	  Time: 0 seconds
+
+	  OK (4 tests, 6 assertions)
+          ------------------------------------------------------------
+
+	クラスごとにテストを実行するとき
+
+	  テストクラスを指定して実行します.
+          ------------------------------------------------------------
+	  $ phpunit LC_Page_Test class/page/LC_Page_Test.php 
+	  PHPUnit 3.3.17 by Sebastian Bergmann.
+
+	  ..........
+
+	  Time: 0 seconds
+
+	  OK (10 tests, 11 assertions)
+          ------------------------------------------------------------
+
