質問 > その他 > PHPUnitの実行について |
その他
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | 下へ |
投稿者 | スレッド |
---|---|
suruseas |
投稿日時: 2013/5/8 17:40
対応状況: −−−
|
半人前 登録日: 2013/5/8 居住地: 投稿: 21 |
PHPUnitの実行について Ver2.12.3(正式版)をダウンロードしました。インストール後ソースに修正を加えず、下記サイトを参考にPHPUnitを通そうとしたのですが、エラーが発生します。
<参考サイト> http://svn.ec-cube.net/open_trac/wiki/EC-CUBE標準規約/単体テストガイドライン <エラー> [exec] PHP Fatal error: Maximum function nesting level of '100' reached, aborting! in /xxxxxxx/data/class/util/GC_Utils.php on line 213 エラーを追うと /data/class/util/SC_Utils.php:84 で再起が無限に起こっていました。 原因はサーバの環境変数($_SERVER['SERVER_NAME']、$_SERVER['SERVER_PORT'])がテスト実行時にセットされていなかった為、テスト実行時にグローバル変数をセットすれば通ると思います。 ただ、そもそも通常はテストが通る形で正式版がリリースされているので私の手順がおかしいと思われるのですがなにか足りない手順があるのでしょうか。 #PHP、PHPUnitともに不慣れなので質問自体が間違っているかもしれません・・・。 よろしくお願い致します。 |
suruseas |
投稿日時: 2013/5/8 17:44
対応状況: −−−
|
半人前 登録日: 2013/5/8 居住地: 投稿: 21 |
Re: PHPUnitの実行について すみません、テンプレです。
------------------------------------------------------------------------------------------ [EC-CUBE] Ver2.12.3正式版 [OS] CentOS6.4 [PHP] PHP 5.3.3 [PHPUnit] PHPUnit 3.7.19 ------------------------------------------------------------------------------------------ |
suruseas |
投稿日時: 2013/5/8 19:36
対応状況: −−−
|
半人前 登録日: 2013/5/8 居住地: 投稿: 21 |
Re: PHPUnitの実行について グローバル変数セットしたんですけど、installページの判断はHTTPリクエストが飛ぶんですね。
てことは私、根本的に勘違いしているような…。 |
nanasess |
投稿日時: 2013/5/8 20:05
対応状況: −−−
|
神 登録日: 2006/9/9 居住地: 投稿: 2314 |
Re: PHPUnitの実行について インストーラが起動してしまっているようですが、EC-CUBE のインストールは完了していますか??
|
suruseas |
投稿日時: 2013/5/8 20:34
対応状況: −−−
|
半人前 登録日: 2013/5/8 居住地: 投稿: 21 |
Re: PHPUnitの実行について ご返答ありがとうございます。はい、インストールは完了しています。フロント側、管理機能側も動作は問題なく完了しています。
今回小さなカスタマイズを入れようと思い、現状動いている機能まで影響しないようにお守り代わりにJenkinsでCI回したかったんです。ちなみにJenkinsサーバは手元にあるものを使わざるをえなかったので、SHIFT様から提供されているプラグインは利用できませんでした。 その前段階でつまづいてしまった、という状況です。 |
nanasess |
投稿日時: 2013/5/8 21:18
対応状況: −−−
|
神 登録日: 2006/9/9 居住地: 投稿: 2314 |
Re: PHPUnitの実行について Jenkins で実行した場合に動作しない感じですか??
tests ディレクトリ内の、 phpunit.xml と require.php は適切に設定されていますか?? *.base と *.jenkins があるので、それぞれリネームして、適切に設定しなければいけません。 # カバレッジ率がまだまだなので、どうぞご協力をお願い致しますm(_ _)m |
suruseas |
投稿日時: 2013/5/8 23:01
対応状況: −−−
|
半人前 登録日: 2013/5/8 居住地: 投稿: 21 |
Re: PHPUnitの実行について >tests ディレクトリ内の、 phpunit.xml と require.php は適切に設定されていますか??
>*.base と *.jenkins があるので、それぞれリネームして、適切に設定しなければいけません。 はい、修正した*つもり*です。 JenkinsでNGだったので参考サイトに従い % phing test で単体で実行しても無理でした。 #というか、PHPUnit実行でHTTP通信が発生するってことはseleniumみたいなサーバが起動していないってことなのでしょうか。 とりあえず、上記設定も「つもり」では不確実ですし、そもそも情報が不足していると思いますので、明日もう一度詳細を確認致します! |
suruseas |
投稿日時: 2013/5/10 10:32
対応状況: −−−
|
半人前 登録日: 2013/5/8 居住地: 投稿: 21 |
Re: PHPUnitの実行について 大変遅くなりました。操作手順及びログは以下となります。
よろしくお願い致します。 $ tar zxvf eccube-2.12.3.tar.gz $ cd eccube-2.12.3 $ cp tests/phpunit.xml.base tests/phpunit.xml $ cp tests/require.php.base tests/require.php $ phing -verbose test $ cat reports/stderr.log PHP Fatal error: Maximum function nesting level of '100' reached, aborting! in /home/username/ダウンロード/eccube-2.12.3/data/class/util/GC_Utils.php on line 213 PHP Stack trace: PHP 1. {main}() /usr/bin/phpunit:0 PHP 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46 PHP 3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:129 PHP 4. PHPUnit_Runner_BaseTestRunner->getTest() /usr/share/pear/PHPUnit/TextUI/Command.php:150 PHP 5. PHPUnit_Framework_TestSuite->addTestFiles() /usr/share/pear/PHPUnit/Runner/BaseTestRunner.php:96 PHP 6. PHPUnit_Framework_TestSuite->addTestFile() /usr/share/pear/PHPUnit/Framework/TestSuite.php:416 PHP 7. PHPUnit_Util_Fileloader::checkAndLoad() /usr/share/pear/PHPUnit/Framework/TestSuite.php:355 PHP 8. PHPUnit_Util_Fileloader::load() /usr/share/pear/PHPUnit/Util/Fileloader.php:76 PHP 9. include_once() /usr/share/pear/PHPUnit/Util/Fileloader.php:92 PHP 10. require_once() /home/username/ダウンロード/eccube-2.12.3/tests/class/SC_Date/SC_Date_AccessorTest.php:25 PHP 11. require_once() /home/username/ダウンロード/eccube-2.12.3/tests/class/Common_TestCase.php:8 PHP 12. require_once() /home/username/ダウンロード/eccube-2.12.3/tests/require.php:3 PHP 13. require_once() /home/username/ダウンロード/eccube-2.12.3/html/require.php:35 PHP 14. SC_Utils::sfInitInstall() /home/username/ダウンロード/eccube-2.12.3/data/require_base.php:38 PHP 15. SC_Utils::searchInstallerPath() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:44 PHP 16. SC_Utils::searchInstallerPath() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:84 PHP 17. SC_Utils::searchInstallerPath() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:84 PHP 18. SC_Utils::searchInstallerPath() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:84 〜以下繰り返しなので省略〜 PHP 94. SC_Utils::searchInstallerPath() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:84 PHP 95. SC_Utils::searchInstallerPath() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:84 PHP 96. fopen() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:82 PHP 97. SC_Helper_HandleError::handle_warning() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:82 PHP 98. GC_Utils::gfPrintLog() /home/username/ダウンロード/eccube-2.12.3/data/class/helper/SC_Helper_HandleError.php:107 PHP 99. GC_Utils::gfLogRotation() /home/username/ダウンロード/eccube-2.12.3/data/class/util/GC_Utils.php:197 PHP Fatal error: Call to a member function doAction() on a non-object in /home/username/ダウンロード/eccube-2.12.3/data/class/SC_View.php on line 137 PHP Stack trace: PHP 1. {main}() /usr/bin/phpunit:0 PHP 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46 PHP 3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:129 PHP 4. PHPUnit_Runner_BaseTestRunner->getTest() /usr/share/pear/PHPUnit/TextUI/Command.php:150 PHP 5. PHPUnit_Framework_TestSuite->addTestFiles() /usr/share/pear/PHPUnit/Runner/BaseTestRunner.php:96 PHP 6. PHPUnit_Framework_TestSuite->addTestFile() /usr/share/pear/PHPUnit/Framework/TestSuite.php:416 PHP 7. PHPUnit_Util_Fileloader::checkAndLoad() /usr/share/pear/PHPUnit/Framework/TestSuite.php:355 PHP 8. PHPUnit_Util_Fileloader::load() /usr/share/pear/PHPUnit/Util/Fileloader.php:76 PHP 9. include_once() /usr/share/pear/PHPUnit/Util/Fileloader.php:92 PHP 10. require_once() /home/username/ダウンロード/eccube-2.12.3/tests/class/SC_Date/SC_Date_AccessorTest.php:25 PHP 11. require_once() /home/username/ダウンロード/eccube-2.12.3/tests/class/Common_TestCase.php:8 PHP 12. require_once() /home/username/ダウンロード/eccube-2.12.3/tests/require.php:3 PHP 13. require_once() /home/username/ダウンロード/eccube-2.12.3/html/require.php:35 PHP 14. SC_Utils::sfInitInstall() /home/username/ダウンロード/eccube-2.12.3/data/require_base.php:38 PHP 15. SC_Utils::searchInstallerPath() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:44 PHP 16. SC_Utils::searchInstallerPath() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:84 PHP 17. SC_Utils::searchInstallerPath() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:84 PHP 18. SC_Utils::searchInstallerPath() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:84 〜以下繰り返しなので省略〜 PHP 94. SC_Utils::searchInstallerPath() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:84 PHP 95. SC_Utils::searchInstallerPath() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:84 PHP 96. fopen() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:82 PHP 97. SC_Helper_HandleError::handle_warning() /home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php:82 PHP 98. GC_Utils::gfPrintLog() /home/username/ダウンロード/eccube-2.12.3/data/class/helper/SC_Helper_HandleError.php:107 PHP 99. GC_Utils::gfLogRotation() /home/username/ダウンロード/eccube-2.12.3/data/class/util/GC_Utils.php:197 PHP 101. SC_Helper_HandleError::handle_error() /home/username/ダウンロード/eccube-2.12.3/data/class/helper/SC_Helper_HandleError.php:0 PHP 102. SC_Helper_HandleError::displaySystemError() /home/username/ダウンロード/eccube-2.12.3/data/class/helper/SC_Helper_HandleError.php:180 PHP 103. LC_Page_Error_SystemError_Ex->process() /home/username/ダウンロード/eccube-2.12.3/data/class/helper/SC_Helper_HandleError.php:214 PHP 104. LC_Page_Error_SystemError->process() /home/username/ダウンロード/eccube-2.12.3/data/class_extends/page_extends/error/LC_Page_Error_SystemError_Ex.php:57 PHP 105. LC_Page_Error_SystemError->sendResponse() /home/username/ダウンロード/eccube-2.12.3/data/class/pages/error/LC_Page_Error_SystemError.php:66 PHP 106. SC_Display->prepare() /home/username/ダウンロード/eccube-2.12.3/data/class/pages/error/LC_Page_Error_SystemError.php:104 PHP 107. SC_View->getResponse() /home/username/ダウンロード/eccube-2.12.3/data/class/SC_Display.php:77 PHP 108. Smarty->fetch() /home/username/ダウンロード/eccube-2.12.3/data/class/SC_View.php:100 PHP 109. Smarty->_compile_resource() /home/username/ダウンロード/eccube-2.12.3/data/module/Smarty/libs/Smarty.class.php:1261 PHP 110. Smarty->_compile_source() /home/username/ダウンロード/eccube-2.12.3/data/module/Smarty/libs/Smarty.class.php:1422 PHP 111. Smarty_Compiler->_compile_file() /home/username/ダウンロード/eccube-2.12.3/data/module/Smarty/libs/Smarty.class.php:1489 PHP 112. call_user_func_array() /home/username/ダウンロード/eccube-2.12.3/data/module/Smarty/libs/Smarty_Compiler.class.php:249 PHP 113. SC_View->prefilter_transform() /home/username/ダウンロード/eccube-2.12.3/data/module/Smarty/libs/Smarty_Compiler.class.php:249 $ cat data/logs/error.log 2013/05/10 10:22:13 [/usr/bin/phpunit] Warning(E_WARNING): fopen(://:/) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: そのようなファイルやディレクトリはありません on [/home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php(82)] from 〜以下繰り返しなので省略〜 2013/05/10 10:22:13 [/usr/bin/phpunit] Warning(E_WARNING): fopen(://:/) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: そのようなファイルやディレクトリはありません on [/home/username/ダウンロード/eccube-2.12.3/data/class/util/SC_Utils.php(82)] from 2013/05/10 10:22:13 [/usr/bin/phpunit] Fatal error(E_ERROR): Maximum function nesting level of '100' reached, aborting! on [/home/username/ダウンロード/eccube-2.12.3/data/class/util/GC_Utils.php(213)] from customer_id = |
nanasess |
投稿日時: 2013/5/10 10:39
対応状況: −−−
|
神 登録日: 2006/9/9 居住地: 投稿: 2314 |
Re: PHPUnitの実行について 引用:
phing を実行する前に、 EC-CUBE をインストールしておく必要がありますが、インストールされていますか? eccube-2.12.3/data/config/config.php は正常に作成されていますか? ECCUBE_INSTALL 定数が ON になっていないと data/require_base.php によってインストーラのディレクトリを探しにいきます。 |
suruseas |
投稿日時: 2013/5/10 16:05
対応状況: −−−
|
半人前 登録日: 2013/5/8 居住地: 投稿: 21 |
Re: PHPUnitの実行について 完全に申し訳ないです(汗
先ほどの手順はごちゃごちゃしてきたので、再度クリーンな環境で試した結果でした(そしてインストール作業を抜いてしまった、と) ご指摘を踏まえてインストールが完了しているフォルダで実行したところ、単純にphpunit.xmlがないと怒られていました…。そこで、phpunit.xmlを作成したところテストが進んでいることを確認できました!ありがとうございます!!そしてすみません(汗 ただ、途中でエラーが発生してしまっています。これはこのスレで続けてしまってもよいですか?それとも別スレであげる内容でしょうか? 取り急ぎ、エラー内容を添付しました。
|
(1) 2 3 » |
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | トップ |