Skip to content

Commit

Permalink
Test for datagrid filter submit
Browse files Browse the repository at this point in the history
  • Loading branch information
elring authored and Pavel Janda committed Feb 14, 2022
1 parent dc1b2e2 commit a91ad12
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/Cases/FilterTest.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

namespace Ublaboo\DataGrid\Tests\Cases;

require __DIR__ . '/../bootstrap.php';

use Nette\Application\AbortException;
use Tester\Assert;
use Tester\TestCase;
use Ublaboo\DataGrid\DataGrid;
use Ublaboo\DataGrid\Tests\Files\TestingDataGridFactoryRouter;

final class FilterTest extends TestCase
{

public function testFilterSubmit(): void
{
$factory = new TestingDataGridFactoryRouter();
/** @var DataGrid $grid */
$grid = $factory->createTestingDataGrid()->getComponent('grid');
$filterForm = $grid->createComponentFilter();

Assert::exception(function() use ($grid, $filterForm): void {
$grid->filterSucceeded($filterForm);
}, AbortException::class);
}

}

(new FilterTest)->run();

0 comments on commit a91ad12

Please sign in to comment.