良い一日
プロジェクトに PHP Symfony 1.4.20 フレームワークを使用しています。タスクの実行が完了すると、生成されたデータベースからデータをキャプチャし、この非同期スクリプトの動作の出力を監視するために、タスクを開始する機能テスト ページを作成しました。問題は、TASK が呼び出されると、すべての Doctrine クエリと TASK 出力が出力され、test:all を実行すると、テスト ケースがすべて成功したとしても疑わしい出力が生成されることです。 私の質問:機能テスト スクリプトからこの出力を抑制するにはどうすればよいですか?
TASK CALL の例を次に示します。
chdir ( sfConfig::get ( 'sf_root_dir' ) ); // Trick plugin into thinking you are in a project directory
$task = new someTask ( $this->dispatcher, new sfFormatter () );
$task->run ( array (), array (
'limit' => '1000',
'env' => 'dev'
) );
抑制したい出力の例を次に示します
2013-08-29 20:34:56: TASK STARTED
>> Doctrine_Connection_Statement execute : SELECT m.id AS m__id, m.subscription_id AS m__subscription_id, m.object AS m__object, m.status AS m__status, m.retries AS m__retries, m.type AS m__type, m.created_at AS m__created_at, m.updated_at AS m__updated_at FROM message_queue m WHERE (m.status = ?) LIMIT 1000 - (1)
>> Doctrine_Connection_Statement execute : SELECT s.id AS s__id, s.mobile_id AS s__mobile_id, s.campaign_id AS s__campaign_id, s.status AS s__status, s.send_content_message AS s__send_content_message, s.last_sent_content_group_rel_id AS s__last_sent_content_group_rel_id, s.billed_total AS s__billed_total, s.billed_current_month AS s__billed_current_month, s.billed_count AS s__billed_count, s.created_at AS s__created_at, s.updated_at AS s__updated_at FROM subscription s WHERE (s.id = ?) - (188)
>> Doctrine_Connection_Statement execute : INSERT INTO log_tx (subscription_id, is_content_message, billing_rule_id, content_charge, toaddress, mobile_network_id, content, toc, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - (188, 1, 4, 250, 27820000090, 2, Test for legal mobile, SMS, 2013-08-29 20:34:56, 2013-08-29 20:34:56)
>> Doctrine_Connection_Statement execute : UPDATE message_queue SET status = ?, updated_at = ? WHERE id = ? - (0, 2013-08-29 20:34:57, 694)
2013-08-29 20:34:57: SUCCESS: Message id [694] processed to [27820000090]
2013-08-29 20:34:57: TASK COMPLETED
>> Doctrine_Connection_Statement execute : SELECT MAX(l.id) AS l__0 FROM log_tx l WHERE (l.subscription_id = ? AND l.content_charge > 0) - (188)
>> Doctrine_Connection_Statement execute : SELECT l.id AS l__id, l.toaddress AS l__toaddress, l.subscription_id AS l__subscription_id, l.mobile_network_id AS l__mobile_network_id, l.toc AS l__toc, l.content AS l__content, l.content_charge AS l__content_charge, l.delivery_status AS l__delivery_status, l.sub_code AS l__sub_code, l.result_text AS l__result_text, l.is_content_message AS l__is_content_message, l.billing_rule_id AS l__billing_rule_id, l.created_at AS l__created_at, l.updated_at AS l__updated_at FROM log_tx l WHERE (l.id = ?) - (858)
ok 2 - LogTx Content Charge Matches
OK 2 - LogTx Content Charge Matchesが合格したテスト ケースであることがわかります。
私はこの答えを探しましたが、これまで誰もこの問題を抱えていなかったようですので、どんな助けも大歓迎です. たぶん私はそれをすべて間違っていますか?
前もって感謝します...