Skip to content

Commit 1a673e1

Browse files
adriafigueressoyuka
authored andcommitted
tests: boolean filter test
1 parent 3768511 commit 1a673e1

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace ApiPlatform\Laravel\Tests\Eloquent\Filter;
15+
16+
use ApiPlatform\Laravel\Eloquent\Filter\BooleanFilter;
17+
use ApiPlatform\Metadata\QueryParameter;
18+
use Illuminate\Database\Eloquent\Builder;
19+
use PHPUnit\Framework\TestCase;
20+
21+
final class BooleanFilterTest extends TestCase
22+
{
23+
public function testOperator(): void
24+
{
25+
$f = new BooleanFilter();
26+
$builder = $this->createStub(Builder::class);
27+
$this->assertEquals($builder, $f->apply($builder, ['is_active' => 'true'], new QueryParameter(key: 'isActive', property: 'is_active')));
28+
}
29+
}

0 commit comments

Comments
 (0)