Skip to content

Commit 1fc1bd5

Browse files
committed
Tests: refactoring
1 parent 1d29b40 commit 1fc1bd5

File tree

4 files changed

+8
-21
lines changed

4 files changed

+8
-21
lines changed

tests/bootstrap.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<?php declare(strict_types = 1);
22

3-
require_once __DIR__ . '/../vendor/autoload.php';
3+
use Contributte\Tester\Environment;
44

5-
Tester\Environment::setup();
6-
Tester\Environment::bypassFinals();
7-
date_default_timezone_set('Europe/Prague');
8-
9-
if (!is_dir(__DIR__ . '/../tmp')) {
10-
mkdir(__DIR__ . '/../tmp/');
5+
if (@!include __DIR__ . '/../vendor/autoload.php') {
6+
echo 'Install Nette Tester using `composer update --dev`';
7+
exit(1);
118
}
129

13-
define('TEMP_DIR', __DIR__ . '/../tmp/' . getmypid());
14-
Tester\Helpers::purge(TEMP_DIR);
10+
Environment::setup(__DIR__);
11+
Environment::setupFinals();

tests/cases/DI/MenuExtensionTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Contributte\MenuControl\MenuContainer;
66
use Contributte\MenuControl\UI\MenuComponent;
77
use Contributte\MenuControl\UI\MenuComponentFactory;
8+
use Contributte\Tester\Environment;
89
use Nette\Application\Request as ApplicationRequest;
910
use Nette\Application\Responses\TextResponse;
1011
use Nette\Bootstrap\Configurator;
@@ -72,7 +73,7 @@ public function testRender(): void
7273
private function createContainer(): Container
7374
{
7475
$config = new Configurator();
75-
$config->setTempDirectory(TEMP_DIR);
76+
$config->setTempDirectory(Environment::getTestDir());
7677
$config->addConfig(__DIR__ . '/config.neon');
7778

7879
return $config->createContainer();

tests/php.ini

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/phpcs-ruleset.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)