Skip to content

Commit

Permalink
Remove unused property $entityMapObserver
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Jul 13, 2023
1 parent 3e2e42f commit 35349eb
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions tests/UnifiedSpecTests/UnifiedTestRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ final class UnifiedTestRunner
/** @var EntityMap */
private $entityMap;

/** @var callable(EntityMap):void */
private $entityMapObserver;

/** @var FailPointObserver */
private $failPointObserver;

Expand Down Expand Up @@ -113,31 +110,10 @@ public function run(UnifiedTestCase $test): void

throw $e;
} finally {
/* An EntityMap observer should be invoked irrespective of the test
* succeeding or failing. Since the callable itself might throw, we
* need to ensure doTearDown() will still be called. */
try {
if (isset($this->entityMapObserver, $this->entityMap)) {
call_user_func($this->entityMapObserver, $this->entityMap);
}
} finally {
$this->doTearDown($hasFailed);
}
$this->doTearDown($hasFailed);
}
}

/**
* Defines a callable to receive the EntityMap after each test.
*
* This function is primarily used by the Atlas testing workload executor.
*
* @param callable(EntityMap):void $entityMapObserver
*/
public function setEntityMapObserver(callable $entityMapObserver): void
{
$this->entityMapObserver = $entityMapObserver;
}

private function doSetUp(): void
{
/* The transactions spec advises calling killAllSessions only at the
Expand Down Expand Up @@ -193,13 +169,6 @@ private function doTestCase(stdClass $test, string $schemaVersion, ?array $runOn

$context = $this->createContext();

/* If an EntityMap observer has been configured, assign the Context's
* EntityMap to a class property so it can later be accessed from run(),
* irrespective of whether this test succeeds or fails. */
if (isset($this->entityMapObserver)) {
$this->entityMap = $context->getEntityMap();
}

if (isset($createEntities)) {
$context->createEntities($createEntities);
}
Expand Down

0 comments on commit 35349eb

Please sign in to comment.