Skip to content

Commit

Permalink
Move over testRecords property
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Jan 25, 2023
1 parent 4ba2b93 commit 9fdf0f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
7 changes: 7 additions & 0 deletions Civi/Test/Api4TestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
*/
trait Api4TestTrait {

/**
* Records created which will be deleted during tearDown
*
* @var array
*/
private $testRecords = [];

/**
* Inserts a test record, supplying all required values if not provided.
*
Expand Down
12 changes: 2 additions & 10 deletions tests/phpunit/api/v4/Api4TestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
namespace api\v4;

use Civi\Api4\UFMatch;
use Civi\Test;
use Civi\Test\Api4TestTrait;
use Civi\Test\CiviEnvBuilder;
use Civi\Test\HeadlessInterface;
Expand All @@ -32,13 +33,6 @@ class Api4TestBase extends TestCase implements HeadlessInterface {

use Api4TestTrait;

/**
* Records created which will be deleted during tearDown
*
* @var array
*/
public $testRecords = [];

/**
* @see CiviUnitTestCase
*
Expand All @@ -52,13 +46,11 @@ public function __construct($name = NULL, array $data = [], $dataName = '') {
}

public function setUpHeadless(): CiviEnvBuilder {
return \Civi\Test::headless()->apply();
return Test::headless()->apply();
}

/**
* Post test cleanup.
*
* @throws \CRM_Core_Exception
*/
public function tearDown(): void {
$implements = class_implements($this);
Expand Down

0 comments on commit 9fdf0f4

Please sign in to comment.