Make FnType accept params and content
Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
parent
3a112f4e79
commit
1bc585b2c8
3 changed files with 27 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ use DateTime;
|
|||
use Arendsen\FluxQueryBuilder\Type;
|
||||
use Arendsen\FluxQueryBuilder\Type\CustomType;
|
||||
use Arendsen\FluxQueryBuilder\Type\DurationType;
|
||||
use Arendsen\FluxQueryBuilder\Type\FnType;
|
||||
use Arendsen\FluxQueryBuilder\Type\MathType;
|
||||
use Arendsen\FluxQueryBuilder\Type\RecordType;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
|
@ -79,6 +80,14 @@ final class FactoryTypeTest extends TestCase
|
|||
new CustomType('this can be anything'),
|
||||
'this can be anything'
|
||||
],
|
||||
'FnType with only content' => [
|
||||
new FnType('(r) => ({ r with _value: r._value * r._value })'),
|
||||
'(r) => ({ r with _value: r._value * r._value })'
|
||||
],
|
||||
'FnType with params and content' => [
|
||||
new FnType(['r', 'a'], '({ r with _value: r._value * r._value })'),
|
||||
'(r, a) => ({ r with _value: r._value * r._value })'
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue