diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..e69de29 diff --git a/tests/ConstantPredicateTest.php b/tests/ConstantPredicateTest.php index 10a46f6..752e3f1 100644 --- a/tests/ConstantPredicateTest.php +++ b/tests/ConstantPredicateTest.php @@ -12,6 +12,8 @@ use Kadet\Functional\Predicate\ConstantPredicate; class ConstantPredicateTest extends PHPUnit\Framework\TestCase { + use RandomDataTrait; + private function getTestPredicate() { return function ($arg = null) { @@ -19,20 +21,6 @@ class ConstantPredicateTest extends PHPUnit\Framework\TestCase }; } - public function randomDataProvider() - { - return [ - ['x'], - [false], - [true], - [], - [(object)[]], - [false, true], - [null, true], - [2321321] - ]; - } - /** * @dataProvider randomDataProvider */ diff --git a/tests/RandomDataTrait.php b/tests/RandomDataTrait.php new file mode 100644 index 0000000..4c29765 --- /dev/null +++ b/tests/RandomDataTrait.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright 2018 Kacper Donat + * + * @author Kacper "Kadet" Donat <kacper@kadet.net> + * + * Full license available in separate LICENSE file + */ + +trait RandomDataTrait +{ + public function randomDataProvider() + { + return [ + ['x'], + [false], + [true], + [], + [(object)[]], + [false, true], + [null, true], + [2321321] + ]; + } +} \ No newline at end of file diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..15a3996 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright 2018 Kacper Donat + * + * @author Kacper "Kadet" Donat <kacper@kadet.net> + * + * Full license available in separate LICENSE file + */ + +require_once __DIR__.'/../vendor/autoload.php'; +require_once __DIR__.'/RandomDataTrait.php'; \ No newline at end of file