title: Symfony 1.4 run task within functional test suppress output
body: <p>Good day</p>
  
  <p>I am using PHP Symfony 1.4.20 framework for a project. I have build functional testing pages which kick off TASKS in order to, once the task completed running, capture the data from the database which it produced, and monitor the output of this asynchronous script behavior. The problem is, that when a TASK is called, it outputs all the Doctrine queries and TASK output which, when performing a test:all, produces dubious output, even though the test cases all succeed.
  <strong>My Question:</strong> How do I suppress this output from my functional test script?</p>
  
  <p><strong>Here is an example of the TASK CALL</strong></p>
  
  <pre><code>chdir ( sfConfig::get ( 'sf_root_dir' ) ); // Trick plugin into thinking you are in a project directory
  $task = new someTask ( $this-&gt;dispatcher, new sfFormatter () );
  $task-&gt;run ( array (), array (
          'limit' =&gt; '1000',
          'env' =&gt; 'dev' 
  ) );
  </code></pre>
  
  <p><strong>Here is an example of the output I wish to suppress</strong></p>
  
  <pre><code>2013-08-29 20:34:56: TASK STARTED
  &gt;&gt; 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)
  &gt;&gt; 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)
  &gt;&gt; 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)
  &gt;&gt; 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
  &gt;&gt; Doctrine_Connection_Statement execute : SELECT MAX(l.id) AS l__0 FROM log_tx l WHERE (l.subscription_id = ? AND l.content_charge &gt; 0) - (188)
  &gt;&gt; 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
  </code></pre>
  
  <p>You will notice <strong>ok 2 - LogTx Content Charge Matches</strong> which is a test case that passed</p>
  
  <p>I have searched for this answer, but it seems like no one has had this problem before so any help will be greatly appreciated. Maybe I am doing it all wrong?</p>
  
  <p>Thanks in advance...</p>