Skip to content

Commit

Permalink
Tests: use toolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Jan 13, 2021
1 parent 7356e6c commit 9355c7d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion tests/cases/ExtraConfigurator.parseCase.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

namespace Tests;

use Ninjify\Nunjuck\Toolkit;
use Tester\Assert;
use Tests\Mocks\MockExtraConfigurator;

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

// Custom parse case
test(function (): void {
Toolkit::test(function (): void {
$_SERVER = [];
env('NETTE__USer', 'felix');

Expand Down
3 changes: 2 additions & 1 deletion tests/cases/ExtraConfigurator.parseDelimiter.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

namespace Tests;

use Ninjify\Nunjuck\Toolkit;
use Tester\Assert;
use Tests\Mocks\MockExtraConfigurator;

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

// Custom delimiter
test(function (): void {
Toolkit::test(function (): void {
$_SERVER = [];
env('NETTE.DATABASE.HOST', 'localhost');

Expand Down
11 changes: 6 additions & 5 deletions tests/cases/ExtraConfigurator.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

namespace Tests;

use Ninjify\Nunjuck\Toolkit;
use Tester\Assert;
use Tests\Mocks\MockExtraConfigurator;

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

// Parsing NETTE__ parameters
test(function (): void {
Toolkit::test(function (): void {
$_SERVER = [];
env('NETTE__FOOBAR__BAR', 'foobar1');
env('NETTE__FOOBAR__BAZ', 'foobar2');
Expand All @@ -25,7 +26,7 @@ test(function (): void {
});

// Parsing all ENV parameters
test(function (): void {
Toolkit::test(function (): void {
$_SERVER = [];
env('NETTE__FOOBAR__BAR', 'foobar1');
env('NETTE_INVALID', 'foobar3');
Expand All @@ -41,7 +42,7 @@ test(function (): void {
});

// ENV Debug mode
test(function (): void {
Toolkit::test(function (): void {
$_SERVER = [];
$configurator = new MockExtraConfigurator();

Expand Down Expand Up @@ -80,7 +81,7 @@ test(function (): void {
});

// FILE Debug mode
test(function (): void {
Toolkit::test(function (): void {
$configurator = new MockExtraConfigurator();
$configurator->setDebugMode(false);
$fileName = TEMP_DIR . '/.debug';
Expand Down Expand Up @@ -120,7 +121,7 @@ test(function (): void {
});

// Passing parameters to configurator
test(function (): void {
Toolkit::test(function (): void {
$_SERVER = [];
env('NETTE__DATABASE__HOST', 'localhost');

Expand Down
5 changes: 3 additions & 2 deletions tests/cases/PluggableConfigurator.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ namespace Tests;

use Contributte\Bootstrap\PluggableConfigurator;
use Ninjify\Nunjuck\Notes;
use Ninjify\Nunjuck\Toolkit;
use Tester\Assert;
use Tests\Mocks\MockContainerPlugin;
use Tests\Mocks\MockDebugContainerPlugin;

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

test(function (): void {
Toolkit::test(function (): void {
$pluggable = new PluggableConfigurator();
$pluggable->setTempDirectory(TEMP_DIR);

Expand All @@ -23,7 +24,7 @@ test(function (): void {
Assert::equal([MockContainerPlugin::class], Notes::fetch());
});

test(function (): void {
Toolkit::test(function (): void {
$pluggable = new PluggableConfigurator();
$pluggable->setTempDirectory(TEMP_DIR);
unset($pluggable->defaultExtensions['di']);
Expand Down

0 comments on commit 9355c7d

Please sign in to comment.