Skip to content

Commit 01e15b9

Browse files
committed
Tests: refactor
1 parent 2282868 commit 01e15b9

File tree

5 files changed

+11
-39
lines changed

5 files changed

+11
-39
lines changed

tests/.coveralls.yml

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

tests/.gitignore

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

tests/Cases/Utils/DocBuilder.phpt

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

3-
/**
4-
* Test: Utils\DocBuilder
5-
*/
6-
require __DIR__ . '/../../bootstrap.php';
7-
83
use Contributte\Nextras\Orm\Generator\Utils\DocBuilder;
4+
use Contributte\Tester\Toolkit;
95
use Tester\Assert;
106

11-
test(function (): void {
7+
require __DIR__ . '/../../bootstrap.php';
8+
9+
Toolkit::test(function (): void {
1210
$b = new DocBuilder();
1311
Assert::equal('', (string) $b);
1412

tests/Cases/Utils/Helpers.phpt

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

3-
/**
4-
* Test: Utils\Helpers
5-
*/
6-
7-
require __DIR__ . '/../../bootstrap.php';
8-
93
use Contributte\Nextras\Orm\Generator\Utils\Helpers;
4+
use Contributte\Tester\Toolkit;
105
use Tester\Assert;
116

12-
/**
13-
* Helpers::camelCase
14-
*/
15-
test(function (): void {
7+
require __DIR__ . '/../../bootstrap.php';
8+
9+
Toolkit::test(function (): void {
1610
Assert::equal('foo', Helpers::camelCase('foo'));
1711
Assert::equal('fooBar', Helpers::camelCase('fooBar'));
1812
Assert::equal('fooBar', Helpers::camelCase('foo bar'));
@@ -25,10 +19,7 @@ test(function (): void {
2519
Assert::equal('fooBar1', Helpers::camelCase('foo !@#$%^&*{}[]() bar 1'));
2620
});
2721

28-
/**
29-
* Helpers::stripMnDelimiters
30-
*/
31-
test(function (): void {
22+
Toolkit::test(function (): void {
3223
Assert::equal('foobar', Helpers::stripMnDelimiters('foo_has_bar'));
3324
Assert::equal('foobar', Helpers::stripMnDelimiters('foo_x_bar'));
3425
Assert::equal('foobar', Helpers::stripMnDelimiters('foo_to_bar'));

tests/bootstrap.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
<?php declare(strict_types = 1);
22

3-
use Ninjify\Nunjuck\Environment;
3+
use Contributte\Tester\Environment;
44

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

10-
// Configure environment
11-
Environment::setupTester();
12-
Environment::setupTimezone();
13-
Environment::setupVariables(__DIR__);
10+
Environment::setup(__DIR__);

0 commit comments

Comments
 (0)