Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxConformance::testSqlOperators cleanup fix - ensure entities are deleted #18569

Merged
merged 1 commit into from
Sep 24, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Sep 23, 2020

Overview

Fixes SyntaxConformance::testSqlOperators to clean up after itself

Before

The tearDown works for other tests in the class but not this one

$ids var is unused but appears to have been for delete tracking

Screen Shot 2020-09-24 at 6 57 16 AM

After

Entities deleted

Screen Shot 2020-09-24 at 6 59 06 AM

Technical Details

Tear Down iterates $this->deletableTestObjects

  public function tearDown() {
    foreach ($this->deletableTestObjects as $entityName => $entities) {
      foreach ($entities as $entityID) {
        CRM_Core_DAO::deleteTestObjects($entityName, ['id' => $entityID]);
      }
    }
  }

Comments

@civibot
Copy link

civibot bot commented Sep 23, 2020

(Standard links)

@civibot civibot bot added the master label Sep 23, 2020
@eileenmcnaughton eileenmcnaughton changed the title Test cleanup fix Test cleanup fix - ensure entities are deleted Sep 23, 2020
@eileenmcnaughton eileenmcnaughton changed the title Test cleanup fix - ensure entities are deleted SyntaxConformance::testSqlOperators cleanup fix - ensure entities are deleted Sep 23, 2020
@colemanw colemanw merged commit 0d3f108 into civicrm:master Sep 24, 2020
@eileenmcnaughton eileenmcnaughton deleted the synt branch September 24, 2020 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants