Skip to content

Commit

Permalink
chore: refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Nov 4, 2023
1 parent 446ab49 commit aa5d1e7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Pest\Stressless\ValueObjects\Result;
use Pest\Stressless\ValueObjects\Url;
use Pest\TestSuite;
use PHPUnit\Framework\TestCase;

/**
* @internal
Expand Down Expand Up @@ -139,10 +140,19 @@ public function __get(string $name): mixed
return $this->{$name}(); // @phpstan-ignore-line
}

/**
* Destructs the run factory.
*/
public function __destruct()
{
if (! $this->result instanceof Result && TestSuite::getInstance()->test === null) {
$this->dd();
if ($this->result instanceof Result) {
return;
}

if (TestSuite::getInstance()->test instanceof TestCase) {
return;
}

$this->dd();
}
}

0 comments on commit aa5d1e7

Please sign in to comment.