Skip to content
Snippets Groups Projects
Unverified Commit 88f46464 authored by colemanw's avatar colemanw Committed by GitHub
Browse files

Merge pull request #20901 from demeritcowboy/fix-api4test

[NFC/Unit test] #2699 - Fix intermittent api4 test (part 1)
parents 3a211bc5 cfc646cb
Branches
Tags
No related merge requests found
......@@ -31,6 +31,11 @@ abstract class BaseCustomValueTest extends UnitTestCase {
* @throws \API_Exception
*/
public function tearDown(): void {
$optgroups = CustomField::get(FALSE)->addSelect('option_group_id')->addWhere('option_group_id', 'IS NOT NULL')->execute();
foreach ($optgroups as $optgroup) {
\Civi\Api4\OptionValue::delete(FALSE)->addWhere('option_group_id', '=', $optgroup['option_group_id'])->execute();
\Civi\Api4\OptionGroup::delete(FALSE)->addWhere('id', '=', $optgroup['option_group_id'])->execute();
}
CustomField::delete(FALSE)->addWhere('id', '>', 0)->execute();
CustomGroup::delete(FALSE)->addWhere('id', '>', 0)->execute();
parent::tearDown();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment