Skip to content

Commit

Permalink
Use Trait directly from managed entity test
Browse files Browse the repository at this point in the history
I'm not sure if the test fail was an intermittent or related but this seems cleaner
  • Loading branch information
eileenmcnaughton committed Jan 25, 2023
1 parent 9fdf0f4 commit 72d3d0e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/phpunit/api/v4/Entity/ManagedEntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,30 @@

namespace api\v4\Entity;

use api\v4\Api4TestBase;
use Civi\Api4\Domain;
use Civi\Api4\Group;
use Civi\Api4\Managed;
use Civi\Api4\Navigation;
use Civi\Api4\OptionGroup;
use Civi\Api4\OptionValue;
use Civi\Api4\SavedSearch;
use Civi\Test;
use Civi\Test\CiviEnvBuilder;
use Civi\Test\HeadlessInterface;
use Civi\Test\HookInterface;
use Civi\Test\TransactionalInterface;
use CRM_Core_ManagedEntities;
use CRM_Core_Module;
use CRM_Utils_System;
use PHPUnit\Framework\TestCase;

/**
* @group headless
*/
class ManagedEntityTest extends Api4TestBase implements TransactionalInterface, HookInterface {
class ManagedEntityTest extends TestCase implements HeadlessInterface, TransactionalInterface, HookInterface {

use Test\Api4TestTrait;

/**
* @var array[]
*/
Expand All @@ -46,6 +52,10 @@ public function setUp(): void {
parent::setUp();
}

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

public function hook_civicrm_managed(array &$entities): void {
$entities = array_merge($entities, $this->_managedEntities);
}
Expand Down

0 comments on commit 72d3d0e

Please sign in to comment.