add phpunit config
This commit is contained in:
parent
1a0c6a5bc8
commit
287f07dba6
0
phpunit.xml
Normal file
0
phpunit.xml
Normal file
@ -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
|
||||
*/
|
||||
|
25
tests/RandomDataTrait.php
Normal file
25
tests/RandomDataTrait.php
Normal file
@ -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]
|
||||
];
|
||||
}
|
||||
}
|
11
tests/bootstrap.php
Normal file
11
tests/bootstrap.php
Normal file
@ -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';
|
Loading…
Reference in New Issue
Block a user