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('コンパイル済みファイルの格納先の中身'); }
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('コピー先のファイル一覧'); }