* 変更点一覧
-** 2.5.0-dev
+** 2.3.5
*** features
+- PEAR チャンネルサーバに ethna/simpletest, ethna/Smarty を追加
+-- インストール後のsimpletest, Smartyのパスで悩む罠を軽減することが目的
+-- pear コマンドで Ethna をインストールするときにこれらを Optional に依存するように設定。既存のインストールを考慮して、required にはしていない。
- Ethnaコマンドに一般的なテストケースコマンドとして add-test コマンドを追加(thanks: BoBpp)
-- ethna add-test -s [skelname] [name] で実行できます
-- http://blog.as-roma.com/BoBlog/index.php?itemid=1338
+-- これは自動登録されるため、[appid]_UnitTestManager に定義を追加する必要はありません(thanks: id:okonomi)
+--- http://d.hatena.ne.jp/okonomi/20080408
- Ethna_Renderer_Rhacoを追加(experimental)
- Ethna_DB_ADOdbのdebug時のログ出力をEthnaのLoggerに変更(@see http://d.hatena.ne.jp/sotarok/20071224)
- Ethna add-[|action|view]-test コマンドで生成されるテストケースがデフォルトでfailするように改善
}
/** バージョン定義 */
-define('ETHNA_VERSION', '2.3.2');
+define('ETHNA_VERSION', '2.3.5');
/** Ethnaベースディレクトリ定義 */
define('ETHNA_BASE', dirname(__FILE__));
// x.0.y -> beta
// x.1.y -> stable
$major_version = "2.3";
-$minor_version = "2";
+$minor_version = "5";
if ($state == 'alpha' || $state == 'beta') {
$version = $major_version . strftime('.%Y%m%d%H');
'baseinstalldir' => 'Ethna',
'packagedirectory' => dirname(dirname(__FILE__)),
'filelistgenerator' => 'file',
- 'ignore' => array('CVS/', '.svn/', 'package.xml', 'ethna_make_package.php', 'ethna_make_package.sh'),
+ 'ignore' => array('CVS/', '.svn/', 'package.xml', 'ethna_make_package.php', 'ethna_make_package.sh', '*optional_package*', ),
'changelogoldtonew' => false,
'exceptions' => array('README' => 'doc', 'LICENSE' => 'doc', 'CHANGES' => 'doc'),
'description' => $description,
'installas' => array('bin/ethna.sh' => 'ethna', 'bin/ethna.bat' => 'ethna.bat'),
);
+$ethna_channel = 'pear.ethna.jp';
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions($config);
$packagexml->setPackage($package);
$packagexml->setSummary('Ethna PHP Framework Package');
$packagexml->setDescription($description);
-$packagexml->setChannel('pear.ethna.jp');
+$packagexml->setChannel($ethna_channel);
$packagexml->setAPIVersion($version);
$packagexml->setReleaseVersion($version);
$packagexml->setReleaseStability($state);
$packagexml->setPhpDep('4.1.0');
$packagexml->setPearinstallerDep('1.3.5');
+$packagexml->addPackageDepWithChannel('optional', 'Smarty', $ethna_channel);
+$packagexml->addPackageDepWithChannel('optional', 'simpletest', $ethna_channel);
$packagexml->addMaintainer('lead', 'fujimoto' , 'Masaki Fujimoto', 'fujimoto@php.net');
$packagexml->addMaintainer('lead', 'halt' , 'halt feits', 'halt.feits@gmail.com');
* ビューディレクトリ名を決定する
*
* @access public
- * @return string ã\82¢ã\82¯ã\82·ã\83§ã\83³ディレクトリ
+ * @return string ã\83\93ã\83¥ã\83¼ディレクトリ
*/
function getViewdir()
{
}
/**
+ * (action,view以外の)テストケースを置くディレクトリ名を決定する
+ *
+ * @access public
+ * @return string テストケースを置くディレクトリ
+ */
+ function getTestdir()
+ {
+ return (empty($this->directory['test']) ? ($this->base . (empty($this->base) ? '' : '/')) : ($this->directory['test'] . "/"));
+ }
+
+ /**
* アプリケーションディレクトリ設定を返す
*
* @access public
*/
function ethnaManagerCheckErrorMsg($action_name)
{
- $appid = $this->getAppId();
+ $appid = strtolower($this->getAppId());
$run_action = ($action_name == '__ethna_info__')
? ' show Application Info List '
: ' run Unit Test ';
echo "Ethna cannot {$run_action} under your application setting.<br>";
- echo "HINT: You must set {$appid}/etc/{$appid}.ini debug setting 'true'.<br>";
+ echo "HINT: You must set {$appid}/etc/{$appid}-ini.php debug setting 'true'.<br>";
echo "<br>";
- echo "In {$appid}.ini, please set as follows :<br><br>";
+ echo "In {$appid}-ini.php, please set as follows :<br><br>";
echo "\$config = array ( 'debug' => true, );";
}
continue;
}
- $s = mb_strimwidth($tmp, 0, $width, "", "EUC-JP");
+ $s = mb_strimwidth($tmp, 0, $width, "", "UTF-8");
- // EUC-JPのみ対応
+ //
+ // eucjpのみ対応
+ // TODO: 修正の対象
+ //
$n = strlen($s);
if ($n >= $width && $tmp{$n} != "" && $tmp{$n} != " ") {
while ((ord($s{$n-1}) & 0x80) == 0) {
parent::Ethna_AppManager($backend);
$this->ctl =& Ethna_Controller::getInstance();
$this->class_factory =& $this->ctl->getClassFactory();
+ $this->testcase = array_merge($this->testcase, $this->_getTestCaseList());
+ }
+
+ /**
+ * action, view 以外のテストケースの一覧を取得する
+ *
+ * @access private
+ * @param テストケースが含まれているディレクトリ名
+ */
+ function _getTestCaseList($test_dir = NULL)
+ {
+ $r = array();
+
+ if (is_null($test_dir)) {
+ $test_dir = $this->ctl->getTestdir();
+ }
+ $base = $this->ctl->getBasedir();
+
+ $child_dir_list = array();
+
+ $dh = opendir($test_dir);
+ if ($dh == false) {
+ return;
+ }
+
+ $ext = $this->ctl->getExt('php');
+ while (($file = readdir($dh)) !== false) {
+ if ($file == "." || $file == "..") {
+ continue;
+ }
+ $file = $test_dir . $file;
+
+ if (is_dir($file)) {
+ $child_dir_list[] = $file;
+ continue;
+ }
+
+ if (preg_match("/\.$ext\$/", $file) == 0) {
+ continue;
+ }
+
+ $file = str_replace($this->ctl->getTestdir(), '', $file);
+
+ $key = ereg_replace("^(.*)Test\.$ext", '\1', $file);
+ $key = str_replace('/', '', $key);
+
+ $r[$key] = str_replace($base . '/', '', $this->ctl->getTestdir() . $file);
+ }
+
+ closedir($dh);
+
+ foreach ($child_dir_list as $child_dir) {
+ $tmp = $this->_getTestCaseList($child_dir . "/");
+ $r = array_merge($r, $tmp);
+ }
+
+ return $r;
}
/**
* @access public
* @param string $character_set キャラクタセット
*/
- function Ethna_UnitTestReporter($character_set = 'EUC-JP')
+ function Ethna_UnitTestReporter($character_set = 'UTF-8')
{
$this->SimpleReporter();
$this->_character_set = $character_set;
$base = $this->target_ctl->getBaseDir();
$bin = $this->target_ctl->getDirectory('bin');
$tmp = $this->target_ctl->getDirectory('tmp');
+ $lib = "{$base}/lib";
$dirs = array(
- 'php_dir' => "{$base}/lib",
+ 'php_dir' => "$lib",
'bin_dir' => "{$base}/bin",
'cache_dir' => "{$tmp}/.pear/cache",
- 'download_dir' => "{$tmp}/.pear/download",
- 'temp_dir' => "{$tmp}/.pear/temp",
- 'doc_dir' => "{$tmp}/.pear/doc",
- 'ext_dir' => "{$tmp}/.pear/ext",
- 'data_dir' => "{$tmp}/.pear/data",
- 'test_dir' => "{$tmp}/.pear/test",
+ 'download_dir' => "{$lib}/.pear/download",
+ 'temp_dir' => "{$lib}/.pear/temp",
+ 'doc_dir' => "{$lib}/.pear/doc",
+ 'ext_dir' => "{$lib}/.pear/ext",
+ 'data_dir' => "{$lib}/.pear/data",
+ 'test_dir' => "{$lib}/.pear/test",
);
$default_pearrc = "{$base}"
$encoding = (isset($params['encoding']))
? $params['encoding']
- : 'EUC-JP';
+ : 'UTF-8';
mb_regex_encoding($encoding);
if (mb_ereg($params['mbregexp'], $var) !== 1) {
package_name = Smarty
package_type = php
baseinstalldir = /Smarty
-channel = pear.ethna.jp
+channel = pear.ethna.jp
summary = PHP Template Engine
;description = Most Popular Template Engine
notes = PEAR Style Package
email = andrei@php.net
role = lead
-[maintainer://tsuruoka]
-name = TSURUOKA Naoya
-email = tsuruoka@labs.cybozu.co.jp
-role = helper
-
;[file://<filepath>]
;commandscript = command
;ignore = 1
package_name = simpletest
package_type = php
baseinstalldir = /simpletest
-channel = pear.ethna.jp
+channel = pear.ethna.jp
summary = Unit testing, mock objects and web testing framework for PHP built around test cases.
;description =
notes = PEAR Style Package
email = lastcraft at users.sourceforge.net
role = lead
-[maintainer://ha1t]
-name = halt feits
-email = halt.feits at gmail.com
-role = helper
-
;[file://<filepath>]
;commandscript = command
;ignore = 1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<h1>{$project_id}</h1>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
-<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="{$config.url}css/ethna.css" type="text/css" />
</head>
<body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
- <meta http-equiv="content-type" content="text/html;charset=EUC-JP" />
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<style type="text/css">
<!--
{literal}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja">
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
+ <meta http-equiv="Content-Type" content="text/html; charset="UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>{$app.app_id} - Ethna UnitTest</title>
<style type="text/css">