Skip to content

Commit

Permalink
TracePluginTest: Move setup stash to KintTest
Browse files Browse the repository at this point in the history
  • Loading branch information
jnvsor committed Aug 16, 2024
1 parent eec6233 commit 1854665
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
4 changes: 4 additions & 0 deletions tests/KintTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use Kint\Parser\FsPathPlugin;
use Kint\Parser\SerializePlugin;
use Kint\Parser\ToStringPlugin;
use Kint\Parser\TracePlugin;
use Kint\Renderer\RichRenderer;
use Kint\Renderer\TextRenderer;
use Kint\Zval\BlobValue;
Expand Down Expand Up @@ -60,6 +61,7 @@ class KintTestCase extends TestCase
protected $tostring_plugin_blacklist;
protected $serialize_safe_mode;
protected $serialize_allowed_classes;
protected $trace_plugin_blacklist;

protected function setUp(): void
{
Expand All @@ -86,6 +88,7 @@ protected function setUp(): void
$this->tostring_plugin_blacklist = ToStringPlugin::$blacklist;
$this->serialize_safe_mode = SerializePlugin::$safe_mode;
$this->serialize_allowed_classes = SerializePlugin::$allowed_classes;
$this->trace_plugin_blacklist = TracePlugin::$blacklist;
}

protected function tearDown(): void
Expand Down Expand Up @@ -114,6 +117,7 @@ protected function tearDown(): void
ToStringPlugin::$blacklist = $this->tostring_plugin_blacklist;
SerializePlugin::$safe_mode = $this->serialize_safe_mode;
SerializePlugin::$allowed_classes = $this->serialize_allowed_classes;
TracePlugin::$blacklist = $this->trace_plugin_blacklist;
}

public function assertLike(array $expected, string $actual, string $message = '')
Expand Down
16 changes: 0 additions & 16 deletions tests/Parser/TracePluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,6 @@
*/
class TracePluginTest extends TestCase
{
protected $blacklist_stash;

protected function setUp(): void
{
parent::setUp();

$this->blacklist_stash = TracePlugin::$blacklist;
}

protected function tearDown(): void
{
parent::tearDown();

TracePlugin::$blacklist = $this->blacklist_stash;
}

/**
* @covers \Kint\Parser\TracePlugin::parse
*/
Expand Down

0 comments on commit 1854665

Please sign in to comment.