CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • tests that don't mess with the DB
Pages: [1]

Author Topic: tests that don't mess with the DB  (Read 546 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
tests that don't mess with the DB
April 20, 2011, 05:17:40 am
So,

My understanding is that, now, if we know a test doesn't leave entities behind we add   public $DBResetRequired = false; to it to speed up the suite.

I added a wee check to pledgePaymentTest in the tear down & when it passed I put the above in the set-up. (test checks there are none of the specified entities).

      $error = $this->confirmEntitiesDeleted(array('pledge', 'pledge_payment', 'contribution', 'contact'));
      $this->assertNotEquals(1, $error);


 
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: tests that don't mess with the DB
April 20, 2011, 09:47:22 am
Yeap, that's exactly what the variable does: skip the DB re-init

@michau not sure we need/can assert in the teadDown. For what I understood, that's "clean up", and that's not supposed to fail, but providing some kind of warning is useful indeed


X+

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • tests that don't mess with the DB

This forum was archived on 2017-11-26.