EthnaテストはSmarty依存しているので注意。

% php bin/ethna_run_test.php --verbose
Ethna All tests

 Ethna_ActionForm_Validator_Mbstrmax_Test
  |--- test_Validate_MbMax_String - OK

 Ethna_Class_Test
  |--- test_isError - OK
  |--- test_raiseError - OK
  |--- test_raiseWarning - OK
  |--- test_raiseNotice - OK
  |--- test_error_callback_obj - OK
  |--- test_error_callback_global - OK
  |--- test_error_callback_mixed - OK

 Ethna_ActionForm_FormTemplate_Test
  |--- test_formtemplate_normal - OK
  |--- test_formtemplate_syntaxsugar - OK

 Ethna_ActionError_Test
  |--- test_count - OK
  |--- test_length - OK
  |--- test_iserror - OK
  |--- test_geterrorlist - OK
  |--- test_getmessage - OK
  |--- test_clear - OK

 Ethna_View_500_Test
  |--- test_redirect_500%
test_redirect_500で終ってしまう理由がよくわからなかったのですが、エラー抑制演算子@をはずすと原因がわかりました。
$  php bin/ethna_run_test.php --verbose
Ethna All tests

 Ethna_ActionForm_Validator_Mbstrmax_Test
  |--- test_Validate_MbMax_String - OK

 Ethna_Class_Test
  |--- test_isError - OK
  |--- test_raiseError - OK
  |--- test_raiseWarning - OK
  |--- test_raiseNotice - OK
  |--- test_error_callback_obj - OK
  |--- test_error_callback_global - OK
  |--- test_error_callback_mixed - OK

 Ethna_ActionForm_FormTemplate_Test
  |--- test_formtemplate_normal - OK
  |--- test_formtemplate_syntaxsugar - OK

 Ethna_ActionError_Test
  |--- test_count - OK
  |--- test_length - OK
  |--- test_iserror - OK
  |--- test_geterrorlist - OK
  |--- test_getmessage - OK
  |--- test_clear - OK

 Ethna_View_500_Test
  |--- test_redirect_500

       Error 1!
       Unexpected PHP error [Cannot modify header information - headers already sent by
 (output started at ~/php/Ethna/2.6/github-dqneo/Ethna/test/TextDetailReporter.php:32)]
 severity [2] in
 [~/php/Ethna/2.6/github-dqneo/Ethna/class/ViewClass.php line 276]
       Error 2!
 Unexpected PHP error [template engine is not available: path=Smarty/Smarty.class.php]
 severity [256] in
 [~/php/Ethna/2.6/github-dqneo/Ethna/class/Renderer.php line 330]
Fatal error:
 Class 'Smarty' not found in ~/php/Ethna/2.6/github-dqneo/Ethna/class/Renderer/Smarty.php on line 45

Smartyをインストールしていないのが原因でした。

EthnaそのものがSmartyに依存しているので、当たり前と言えば当たり前なのですが・・・。

当初、テストが中断していることすら気づかなかった(test_redirect_500でテスト終了するものだと思ってた)ので、パッチでも投げようと思います。
カテゴリ: