Skip to content

Commit

Permalink
Tests: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Dec 13, 2023
1 parent 2282868 commit adeb39d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 37 deletions.
4 changes: 0 additions & 4 deletions tests/.coveralls.yml

This file was deleted.

10 changes: 0 additions & 10 deletions tests/.gitignore

This file was deleted.

10 changes: 4 additions & 6 deletions tests/Cases/Utils/DocBuilder.phpt
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?php declare(strict_types = 1);

/**
* Test: Utils\DocBuilder
*/
require __DIR__ . '/../../bootstrap.php';

use Contributte\Nextras\Orm\Generator\Utils\DocBuilder;
use Contributte\Tester\Toolkit;
use Tester\Assert;

test(function (): void {
require __DIR__ . '/../../bootstrap.php';

Toolkit::test(function (): void {
$b = new DocBuilder();
Assert::equal('', (string) $b);

Expand Down
17 changes: 5 additions & 12 deletions tests/Cases/Utils/Helpers.phpt
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
<?php declare(strict_types = 1);

/**
* Test: Utils\Helpers
*/

require __DIR__ . '/../../bootstrap.php';

use Contributte\Nextras\Orm\Generator\Utils\Helpers;
use Contributte\Tester\Toolkit;
use Tester\Assert;

/**
* Helpers::camelCase
*/
test(function (): void {
require __DIR__ . '/../../bootstrap.php';

Toolkit::test(function (): void {
Assert::equal('foo', Helpers::camelCase('foo'));
Assert::equal('fooBar', Helpers::camelCase('fooBar'));
Assert::equal('fooBar', Helpers::camelCase('foo bar'));
Expand All @@ -25,10 +21,7 @@ test(function (): void {
Assert::equal('fooBar1', Helpers::camelCase('foo !@#$%^&*{}[]() bar 1'));
});

/**
* Helpers::stripMnDelimiters
*/
test(function (): void {
Toolkit::test(function (): void {
Assert::equal('foobar', Helpers::stripMnDelimiters('foo_has_bar'));
Assert::equal('foobar', Helpers::stripMnDelimiters('foo_x_bar'));
Assert::equal('foobar', Helpers::stripMnDelimiters('foo_to_bar'));
Expand Down
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__);

0 comments on commit adeb39d

Please sign in to comment.