Skip to content

Commit

Permalink
Tests: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Jul 31, 2023
1 parent b85bf8f commit ebbd1b9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 100 deletions.
26 changes: 26 additions & 0 deletions tests/Cases/DI/TracyBlueScreensExtension.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php declare(strict_types = 1);

use Contributte\Tester\Toolkit;
use Contributte\Tester\Utils\ContainerBuilder;
use Contributte\Tracy\DI\TracyBlueScreensExtension;
use Nette\DI\Compiler;
use Tester\Assert;
use Tracy\Debugger;

require_once __DIR__ . '/../../bootstrap.php';

Toolkit::test(static function (): void {
$rf = new ReflectionClass(Debugger::getBlueScreen());
$panelsrf = $rf->getProperty('panels');
$panelsrf->setAccessible(true);

Assert::count(0, $panelsrf->getValue(Debugger::getBlueScreen()));

ContainerBuilder::of()
->withCompiler(static function (Compiler $compiler): void {
$compiler->addExtension('bluescreens', new TracyBlueScreensExtension());
})
->build();

Assert::count(2, $panelsrf->getValue(Debugger::getBlueScreen()));
});
7 changes: 2 additions & 5 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<?php declare(strict_types = 1);

use Ninjify\Nunjuck\Environment;
use Contributte\Tester\Environment;

if (@!include __DIR__ . '/../vendor/autoload.php') {
echo 'Install Nette Tester using `composer update --dev`';
exit(1);
}

// Configure environment
Environment::setupTester();
Environment::setupTimezone();
Environment::setupVariables(__DIR__);
Environment::setup(__DIR__);
40 changes: 0 additions & 40 deletions tests/cases/DI/NavigationPanelExtension.phpt

This file was deleted.

36 changes: 0 additions & 36 deletions tests/cases/DI/TracyBlueScreensExtension.phpt

This file was deleted.

19 changes: 0 additions & 19 deletions tests/fixtures/RouterFactory.php

This file was deleted.

0 comments on commit ebbd1b9

Please sign in to comment.