Skip to content

Commit

Permalink
Tests: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Nov 28, 2023
1 parent 1d29b40 commit 1fc1bd5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
15 changes: 6 additions & 9 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<?php declare(strict_types = 1);

require_once __DIR__ . '/../vendor/autoload.php';
use Contributte\Tester\Environment;

Tester\Environment::setup();
Tester\Environment::bypassFinals();
date_default_timezone_set('Europe/Prague');

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

define('TEMP_DIR', __DIR__ . '/../tmp/' . getmypid());
Tester\Helpers::purge(TEMP_DIR);
Environment::setup(__DIR__);
Environment::setupFinals();
3 changes: 2 additions & 1 deletion tests/cases/DI/MenuExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Contributte\MenuControl\MenuContainer;
use Contributte\MenuControl\UI\MenuComponent;
use Contributte\MenuControl\UI\MenuComponentFactory;
use Contributte\Tester\Environment;
use Nette\Application\Request as ApplicationRequest;
use Nette\Application\Responses\TextResponse;
use Nette\Bootstrap\Configurator;
Expand Down Expand Up @@ -72,7 +73,7 @@ public function testRender(): void
private function createContainer(): Container
{
$config = new Configurator();
$config->setTempDirectory(TEMP_DIR);
$config->setTempDirectory(Environment::getTestDir());
$config->addConfig(__DIR__ . '/config.neon');

return $config->createContainer();
Expand Down
3 changes: 0 additions & 3 deletions tests/php.ini

This file was deleted.

8 changes: 0 additions & 8 deletions tests/phpcs-ruleset.xml

This file was deleted.

0 comments on commit 1fc1bd5

Please sign in to comment.