Index: branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfPrintRTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfPrintRTest.php	(revision 22193)
+++ branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfPrintRTest.php	(revision 22193)
@@ -0,0 +1,64 @@
+<?php
+
+$HOME = realpath(dirname(__FILE__)) . "/../../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 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.
+ */
+
+/**
+ * SC_Utils::sfPrintR()のテストクラス.
+ *
+ *
+ * @author Hiroko Tamagawa
+ * @version $Id$
+ */
+class SC_Utils_sfPrintRTest extends Common_TestCase {
+
+
+  protected function setUp() {
+    // parent::setUp();
+  }
+
+  protected function tearDown() {
+    // parent::tearDown();
+  }
+
+  /////////////////////////////////////////
+  public function testSfPrintR__指定したオブジェクトの情報が出力される() {
+    $output = '<div style="font-size: 12px;color: #00FF00;">' . "\n"
+      . '<strong>**デバッグ中**</strong><br />' . "\n"
+      . '<pre>' . "\n"
+      . 'array(1) {' . "\n"
+      . '  ["test"]=>' . "\n"
+      . '  string(4) "TEST"' . "\n"
+      . '}' . "\n"
+      . '</pre>' . "\n"
+      . '<strong>**デバッグ中**</strong></div>' . "\n";
+
+    $this->expectOutputString($output);
+    SC_Utils::sfPrintR(array('test'=>'TEST'));
+  }
+
+  //////////////////////////////////////////
+
+}
+
Index: branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfFlushTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfFlushTest.php	(revision 22193)
+++ branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfFlushTest.php	(revision 22193)
@@ -0,0 +1,67 @@
+<?php
+
+$HOME = realpath(dirname(__FILE__)) . "/../../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 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.
+ */
+
+/**
+ * SC_Utils::sfFlush()のテストクラス.
+ * flushされてしまうためexpectOutputString()が使えないので、
+ * 逆にflushされて空になっていることだけ確認する.
+ *
+ * @author Hiroko Tamagawa
+ * @version $Id$
+ */
+class SC_Utils_sfFlushTest extends Common_TestCase {
+
+
+  protected function setUp() {
+    // parent::setUp();
+  }
+
+  protected function tearDown() {
+    // parent::tearDown();
+  }
+
+  /////////////////////////////////////////
+  public function testSfFlush_IEの場合_フラッシュされる() {
+    $this->expectOutputString('');
+    echo 'Hello, World!!';
+    SC_Utils::sfFlush(TRUE);
+  }
+
+  public function testSfFlush_文字列を指定した場合_フラッシュされる() {
+    $this->expectOutputString('');
+    echo 'Hello, World!!';
+    SC_Utils::sfFlush('Hello');
+  }
+
+  public function testSfFlush_参考_この関数を呼ばないとバッファに出力が残る() {
+    $this->expectOutputString('Hello, World!!');
+    echo 'Hello, World!!';
+  }
+
+  //////////////////////////////////////////
+
+}
+
Index: branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfErrorHeaderTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfErrorHeaderTest.php	(revision 22193)
+++ branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfErrorHeaderTest.php	(revision 22193)
@@ -0,0 +1,66 @@
+<?php
+
+$HOME = realpath(dirname(__FILE__)) . "/../../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 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.
+ */
+
+/**
+ * SC_Utils::sfErrorHeader()のテストクラス.
+ *
+ *
+ * @author Hiroko Tamagawa
+ * @version $Id$
+ */
+class SC_Utils_sfErrorHeaderTest extends Common_TestCase {
+
+
+  protected function setUp() {
+    // parent::setUp();
+  }
+
+  protected function tearDown() {
+    // parent::tearDown();
+  }
+
+  /////////////////////////////////////////
+  public function testSfErrorHeader_printフラグがONの場合_指定したメッセージが出力される() {
+    global $GLOBAL_ERR; 
+    $this->expectOutputString($GLOBAL_ERR . '<div id="errorHeader">ERROR MESSAGE</div>');
+    SC_Utils::sfErrorHeader('ERROR MESSAGE', TRUE);
+  }
+
+  public function testSfErrorHeader_printフラグがOFFの場合_指定したメッセージがグローバル変数に格納される() {
+    global $GLOBAL_ERR;
+    $this->expectOutputString('');
+    $old_err = $GLOBAL_ERR;
+    SC_Utils::sfErrorHeader('ERROR MESSAGE');
+    $this->expected = $old_err . '<div id="errorHeader">ERROR MESSAGE</div>';
+    $this->actual = $GLOBAL_ERR;
+
+    $this->verify();
+  }
+
+  //////////////////////////////////////////
+
+}
+
Index: branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_recursiveMkDirTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_recursiveMkDirTest.php	(revision 22193)
+++ branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_recursiveMkDirTest.php	(revision 22193)
@@ -0,0 +1,74 @@
+<?php
+
+$HOME = realpath(dirname(__FILE__)) . "/../../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 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.
+ */
+
+/**
+ * SC_Utils::recursiveMkDir()のテストクラス.
+ *
+ *
+ * @author Hiroko Tamagawa
+ * @version $Id$
+ */
+class SC_Utils_recursiveMkdirTest extends Common_TestCase {
+
+  static $TMP_DIR;
+
+  protected function setUp() {
+    self::$TMP_DIR = realpath(dirname(__FILE__)) . "/../../../tmp";
+    SC_Helper_FileManager::deleteFile(self::$TMP_DIR);
+    mkdir(self::$TMP_DIR, 0777, true);
+// parent::setUp();
+  }
+
+  protected function tearDown() {
+    // parent::tearDown();
+  }
+
+  /////////////////////////////////////////
+  public function testRecursiveMkdir_パーミッションを指定した場合_指定のパーミッションでディレクトリが作られる() {
+    $path = realpath(dirname(__FILE__)) . "/../../../tmp/dir1/dir2/dir3/";
+    $mode = 0755;
+
+    $result = SC_Utils::recursiveMkdir($path, $mode);
+    $this->expected = '0755';
+    $this->actual = substr(sprintf('%o', fileperms($path)), -4);
+
+    $this->verify();
+  }
+
+  public function testRecursiveMkdir_パーミッションを指定しない場合_0777でディレクトリが作られる() {
+    $path = realpath(dirname(__FILE__)) . "/../../../tmp/dir1/dir2/dir3/";
+
+    $result = SC_Utils::recursiveMkdir($path);
+    $this->expected = '0777';
+    $this->actual = substr(sprintf('%o', fileperms($path)), -4);
+
+    $this->verify();
+  }
+
+  //////////////////////////////////////////
+
+}
+
Index: branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_clearCompliedTemplateTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_clearCompliedTemplateTest.php	(revision 22193)
+++ branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_clearCompliedTemplateTest.php	(revision 22193)
@@ -0,0 +1,62 @@
+<?php
+
+$HOME = realpath(dirname(__FILE__)) . "/../../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 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.
+ */
+
+/**
+ * SC_Utils::clearCompliedTemplate()のテストクラス.
+ *
+ *
+ * @author Hiroko Tamagawa
+ * @version $Id$
+ */
+class SC_Utils_clearCompliedTemplateTest extends Common_TestCase {
+
+
+  protected function setUp() {
+    // parent::setUp();
+  }
+
+  protected function tearDown() {
+    // parent::tearDown();
+  }
+
+  /////////////////////////////////////////
+  public function test__コンパイル済みのファイルを配置するディレクトリが空になる() {
+    SC_Utils::clearCompliedTemplate();
+
+    $this->expected = array();
+    $this->actual = array();
+    Test_Utils::array_append($this->actual, COMPILE_REALDIR);
+    Test_Utils::array_append($this->actual, COMPILE_ADMIN_REALDIR);
+    Test_Utils::array_append($this->actual, SMARTPHONE_COMPILE_REALDIR);
+    Test_Utils::array_append($this->actual, MOBILE_COMPILE_REALDIR);
+
+    $this->verify();
+  }
+
+  //////////////////////////////////////////
+
+}
+
Index: branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_isInternalDomainTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_isInternalDomainTest.php	(revision 22193)
+++ branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_isInternalDomainTest.php	(revision 22193)
@@ -0,0 +1,70 @@
+<?php
+
+$HOME = realpath(dirname(__FILE__)) . "/../../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 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.
+ */
+
+/**
+ * SC_Utils::sfIsInternalDomain()のテストクラス.
+ * HTTP_URL='http://test.local' という前提でテスト.
+ *
+ * @author Hiroko Tamagawa
+ * @version $Id$
+ */
+class SC_Utils_sfIsInternalDomainTest extends Common_TestCase {
+
+
+  protected function setUp() {
+    // parent::setUp();
+  }
+
+  protected function tearDown() {
+    // parent::tearDown();
+  }
+
+  /////////////////////////////////////////
+  public function testsfIsInternalDomain_ドメインが一致する場合_trueが返る() {
+    $this->expected = TRUE;
+    $this->actual = SC_Utils::sfIsInternalDomain('http://test.local/html/index.php');
+
+    $this->verify();
+  }
+
+  public function testsfIsInternalDomain_アンカーを含むURLの場合_trueが返る() {
+    $this->expected = TRUE;
+    $this->actual = SC_Utils::sfIsInternalDomain('http://test.local/html/index.php#hoge');
+
+    $this->verify();
+  }
+
+  public function testsfIsInternalDomain_ドメインが一致しない場合_falseが返る() {
+    $this->expected = TRUE;
+    $this->actual = SC_Utils::sfIsInternalDomain('http://test.local.jp/html/index.php');
+
+    $this->verify();
+  }
+
+  //////////////////////////////////////////
+
+}
+
Index: branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfIsMatchHashPassword_authTypePlainTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfIsMatchHashPassword_authTypePlainTest.php	(revision 22193)
+++ branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfIsMatchHashPassword_authTypePlainTest.php	(revision 22193)
@@ -0,0 +1,69 @@
+<?php
+
+$HOME = realpath(dirname(__FILE__)) . "/../../../..";
+// このテスト専用の定数の設定
+define('AUTH_TYPE', 'PLAIN');
+require_once($HOME . "/tests/class/Common_TestCase.php");
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 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.
+ */
+
+/**
+ * SC_Utils::sfIsMatchHashPassword()のテストクラス.
+ *
+ *
+ * @author Hiroko Tamagawa
+ * @version $Id$
+ */
+class SC_Utils_sfIsMatchHashPassword_authTypePlainTest extends Common_TestCase {
+
+
+  protected function setUp() {
+    // parent::setUp();
+  }
+
+  protected function tearDown() {
+    // parent::tearDown();
+  }
+
+  /////////////////////////////////////////
+  public function testSfIsMatchHashPassword_文字列が一致する場合_trueが返る() {
+    $pass = 'ec-cube';
+    $hashpass = 'ec-cube';
+
+    $this->expected = TRUE;
+    $this->actual = SC_Utils::sfIsMatchHashPassword($pass, $hashpass);
+
+    $this->verify('パスワード文字列比較結果');
+  }
+
+  public function testSfIsMatchHashPassword_文字列が一致しない場合_falseが返る() {
+    $pass = 'ec-cube';
+    $hashpass = 'EC-cube';
+
+    $this->expected = FALSE;
+    $this->actual = SC_Utils::sfIsMatchHashPassword($pass, $hashpass);
+
+    $this->verify('パスワード文字列比較結果');
+  }
+
+}
+
Index: branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfIsMatchHashPassword_authTypeHmacTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfIsMatchHashPassword_authTypeHmacTest.php	(revision 22193)
+++ branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_sfIsMatchHashPassword_authTypeHmacTest.php	(revision 22193)
@@ -0,0 +1,81 @@
+<?php
+
+$HOME = realpath(dirname(__FILE__)) . "/../../../..";
+// このテスト専用の定数の設定
+define('AUTH_TYPE', 'HMAC');
+require_once($HOME . "/tests/class/Common_TestCase.php");
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 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.
+ */
+
+/**
+ * SC_Utils::sfIsMatchHashPassword()のテストクラス.
+ * 暗号化の詳細については特にテストしていない.
+ *
+ * @author Hiroko Tamagawa
+ * @version $Id$
+ */
+class SC_Utils_sfIsMatchHashPassword_authTypeHmacTest extends Common_TestCase {
+
+
+  protected function setUp() {
+    // parent::setUp();
+  }
+
+  protected function tearDown() {
+    // parent::tearDown();
+  }
+
+  /////////////////////////////////////////
+  public function testSfIsMatchHashPassword_ハッシュ化後の文字列が一致する場合_trueが返る() {
+    $pass = 'ec-cube';
+    $salt = 'salt';
+    $hashpass = SC_Utils_Ex::sfGetHashString($pass, $salt);
+
+    $this->expected = TRUE;
+    $this->actual = SC_Utils::sfIsMatchHashPassword($pass, $hashpass, $salt);
+
+    $this->verify('パスワード文字列比較結果');
+  }
+
+  public function testSfIsMatchHashPassword_ハッシュ化後の文字列が一致しない場合_falseが返る() {
+    $pass = 'ec-cube';
+    $salt = 'salt';
+    $hashpass = 'ec-cube';
+
+    $this->expected = FALSE;
+    $this->actual = SC_Utils::sfIsMatchHashPassword($pass, $hashpass, $salt);
+
+    $this->verify('パスワード文字列比較結果');
+  }
+
+  public function testSfIsMatchHashPassword_saltが未指定の場合_旧バージョンの暗号化で比較される() {
+    $pass = 'ec-cube';
+    $hashpass = sha1($pass . ':' . AUTH_MAGIC);
+
+    $this->expected = TRUE;
+    $this->actual = SC_Utils::sfIsMatchHashPassword($pass, $hashpass);
+
+    $this->verify('パスワード文字列比較結果');
+  }
+
+}
+
Index: branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_copyDirectoryTest.php
===================================================================
--- branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_copyDirectoryTest.php	(revision 22193)
+++ branches/version-2_12-dev/tests/class/util/SC_Utils/SC_Utils_copyDirectoryTest.php	(revision 22193)
@@ -0,0 +1,160 @@
+<?php
+
+$HOME = realpath(dirname(__FILE__)) . "/../../../..";
+require_once($HOME . "/tests/class/Common_TestCase.php");
+/*
+ * This file is part of EC-CUBE
+ *
+ * Copyright(c) 2000-2012 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.
+ */
+
+/**
+ * SC_Utils::copyDirectory()のテストクラス.
+ * TODO : 最後にスラッシュがないとうまくいかないのは良いのか？
+ *
+ * @author Hiroko Tamagawa
+ * @version $Id$
+ */
+class SC_Utils_copyDirectoryTest extends Common_TestCase {
+
+  static $TMP_DIR;
+
+  protected function setUp() {
+    // parent::setUp();
+    self::$TMP_DIR = realpath(dirname(__FILE__)) . "/../../../tmp";
+    SC_Helper_FileManager::deleteFile(self::$TMP_DIR);
+    mkdir(self::$TMP_DIR, 0700, true);
+  }
+
+  protected function tearDown() {
+    // parent::tearDown();
+  }
+
+  /////////////////////////////////////////
+  public function testCopyDirectory_存在するパスの場合_指定したパス以下が再帰的にコピーされる() {
+    /**
+     * tests/tmp/src
+     *             /dir10
+     *             /dir20/dir21
+     *                   /file22.txt
+     */
+    mkdir(self::$TMP_DIR . "/src", 0700, true);
+    mkdir(self::$TMP_DIR . "/src/dir10", 0700, true);
+    mkdir(self::$TMP_DIR . "/src/dir20", 0700, true);
+    mkdir(self::$TMP_DIR . "/src/dir20/dir21", 0700, true);
+    $fp = fopen(self::$TMP_DIR . "/src/dir20/file22.txt", "w");
+    fwrite($fp, "ec-cube test");
+    fclose($fp);
+    mkdir(self::$TMP_DIR . "/dst");
+
+    SC_Utils::copyDirectory(self::$TMP_DIR . "/src/", self::$TMP_DIR . "/dst/");
+
+    $this->expected = array("dir10", "dir20", "dir21", "file22.txt");
+    $this->actual = array();
+    Test_Utils::array_append($this->actual, Test_Utils::mapCols(SC_Helper_FileManager::sfGetFileList(self::$TMP_DIR . "/dst"), "file_name"));
+    Test_Utils::array_append($this->actual, Test_Utils::mapCols(SC_Helper_FileManager::sfGetFileList(self::$TMP_DIR . "/dst/dir20"), "file_name"));
+    
+    $this->verify();
+  }
+
+  public function testCopyDirectory_存在しないパスの場合_何も起こらない() {
+    /**
+     * tests/tmp/src
+     *             /dir10
+     *             /dir20/dir21
+     *                   /file22.txt
+     */
+    // mkdir(self::$TMP_DIR . "/src", 0700, true);
+    mkdir(self::$TMP_DIR . "/dst");
+
+    SC_Utils::copyDirectory(self::$TMP_DIR . "/src/", self::$TMP_DIR . "/dst/");
+
+    $this->expected = array();
+    $this->actual = array();
+    
+    $this->verify();
+  }
+
+  public function testCopyDirectory_コピー先のディレクトリが元々存在する場合_上書きされる() {
+    /**
+     * tests/tmp/src
+     *             /dir10
+     *             /dir20/dir21
+     *                   /file22.txt
+     */
+    mkdir(self::$TMP_DIR . "/src", 0700, true);
+    mkdir(self::$TMP_DIR . "/src/dir10", 0700, true);
+    mkdir(self::$TMP_DIR . "/src/dir20", 0700, true);
+    mkdir(self::$TMP_DIR . "/src/dir20/dir21", 0700, true);
+    $fp = fopen(self::$TMP_DIR . "/src/dir20/file22.txt", "w");
+    fwrite($fp, "ec-cube test");
+    fclose($fp);
+    mkdir(self::$TMP_DIR . "/dst");
+    mkdir(self::$TMP_DIR . "/dst/dir20/dir23", 0700, true);
+
+    SC_Utils::copyDirectory(self::$TMP_DIR . "/src/", self::$TMP_DIR . "/dst/");
+
+    $this->expected = array("dir10", "dir20", "dir21", "dir23", "file22.txt");
+    $this->actual = array();
+    Test_Utils::array_append($this->actual, Test_Utils::mapCols(SC_Helper_FileManager::sfGetFileList(self::$TMP_DIR . "/dst"), "file_name"));
+    Test_Utils::array_append($this->actual, Test_Utils::mapCols(SC_Helper_FileManager::sfGetFileList(self::$TMP_DIR . "/dst/dir20"), "file_name"));
+    
+    $this->verify();
+
+  }
+
+  public function testCopyDirectory_コピー先のファイルが元々存在する場合_上書きされる() {
+    /**
+     * tests/tmp/src
+     *             /dir10
+     *             /dir20/dir21
+     *                   /file22.txt
+     */
+    mkdir(self::$TMP_DIR . "/src", 0700, true);
+    mkdir(self::$TMP_DIR . "/src/dir10", 0700, true);
+    mkdir(self::$TMP_DIR . "/src/dir20", 0700, true);
+    mkdir(self::$TMP_DIR . "/src/dir20/dir21", 0700, true);
+    $fp = fopen(self::$TMP_DIR . "/src/dir20/file22.txt", "w");
+    fwrite($fp, "ec-cube test");
+    fclose($fp);
+    mkdir(self::$TMP_DIR . "/dst");
+    mkdir(self::$TMP_DIR . "/dst/dir20");
+    $fp_dist = fopen(self::$TMP_DIR . "/dst/dir20/file22.txt", "w");
+    fwrite($fp_dist, "hello");
+    fclose($fp_dist);
+
+    SC_Utils::copyDirectory(self::$TMP_DIR . "/src/", self::$TMP_DIR . "/dst/");
+
+    $this->expected = array("dir10", "dir20", "dir21", "file22.txt", "ec-cube test");
+    $this->actual = array();
+    Test_Utils::array_append($this->actual, Test_Utils::mapCols(SC_Helper_FileManager::sfGetFileList(self::$TMP_DIR . "/dst"), "file_name"));
+    Test_Utils::array_append($this->actual, Test_Utils::mapCols(SC_Helper_FileManager::sfGetFileList(self::$TMP_DIR . "/dst/dir20"), "file_name"));
+    $fp_final = fopen(self::$TMP_DIR . "/dst/dir20/file22.txt", "r");
+    $read_result = fread($fp_final, 100);
+    fclose($fp_final);
+    $this->actual[] = $read_result;
+
+    $this->verify();
+
+  }
+
+  //////////////////////////////////////////
+
+}
+
Index: branches/version-2_12-dev/tests/class/test/util/Test_Utils.php
===================================================================
--- branches/version-2_12-dev/tests/class/test/util/Test_Utils.php	(revision 22145)
+++ branches/version-2_12-dev/tests/class/test/util/Test_Utils.php	(revision 22193)
@@ -66,4 +66,18 @@
     return $output_array;
   }
+
+  /**
+   * 配列に別の配列をappendします。
+   * $orig_arrayが直接変更されます。
+   * 
+   * @static
+   * @param orig_array 追加先の配列
+   * @param new_array 追加要素を持つ配列
+   */
+  public static function array_append(&$orig_array, $new_array) {
+    foreach ($new_array as $element) {
+      $orig_array[] = $element;
+    }
+  }
 }
 
