Skip to content

Commit

Permalink
Tests: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Nov 15, 2023
1 parent ea1f5e0 commit 285c97c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
@@ -1,9 +1,6 @@
<?php declare(strict_types = 1);

/**
* Test: DI\FormBinder
*/

use Contributte\Tester\Toolkit;
use Contributte\Wordcha\DI\FormBinder;
use Contributte\Wordcha\Factory;
use Contributte\Wordcha\Form\WordchaContainer;
Expand All @@ -17,7 +14,7 @@ use Tester\Assert;

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

test(function (): void {
Toolkit::test(function (): void {
$hash = '12345';
$validator = Mockery::mock(Validator::class);

Expand Down
@@ -1,9 +1,6 @@
<?php declare(strict_types = 1);

/**
* Test: Form\WordchaContainer
*/

use Contributte\Tester\Toolkit;
use Contributte\Wordcha\Factory;
use Contributte\Wordcha\Form\WordchaContainer;
use Contributte\Wordcha\Generator\Generator;
Expand All @@ -15,7 +12,7 @@ use Tester\Assert;

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

test(function (): void {
Toolkit::test(function (): void {
$hash = '12345';
$validator = Mockery::mock(Validator::class);
$generator = Mockery::mock(Generator::class)
Expand All @@ -41,7 +38,7 @@ test(function (): void {
Assert::equal($hash, $captcha['hash']->getValue());
});

test(function (): void {
Toolkit::test(function (): void {
$hash = '12345';
$validator = Mockery::mock(Validator::class)
->shouldReceive('validate')
Expand Down Expand Up @@ -69,7 +66,7 @@ test(function (): void {
Assert::true($validator->validate('foo', 'bar'));
});

test(function (): void {
Toolkit::test(function (): void {
$hash = '12345';

$validator = Mockery::mock(Validator::class)
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
@@ -1,6 +1,6 @@
<?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`';
Expand Down

0 comments on commit 285c97c

Please sign in to comment.