feat: all-season assignments
This commit is contained in:
1 parent
675cec1b69
commit
cf876ed224
119 files changed
+6194
-294
No files matched your search
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\Model;
|
||||
|
||||
use App\Model\TeamerFilterDto;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* The all-season teamer list is a second view onto the same filter DTO: it is always scoped,
|
||||
* but that scope is not something the admin chose. AbstractFilterDto counts every property that
|
||||
* differs from a fresh instance, so an ordinary property would make the list permanently claim
|
||||
* "1 Filter aktiv" and offer a Reset button that resets nothing. The underscore keeps it out.
|
||||
*/
|
||||
class TeamerFilterDtoTest extends TestCase
|
||||
{
|
||||
public function testTheScopeDoesNotCountAsAnActiveFilter(): void
|
||||
{
|
||||
$filterDto = (new TeamerFilterDto())->setAllSeason(true);
|
||||
|
||||
$this->assertTrue($filterDto->isAllSeason());
|
||||
$this->assertSame(0, $filterDto->getActiveFiltersCount());
|
||||
$this->assertFalse($filterDto->isActive());
|
||||
}
|
||||
|
||||
public function testAFilterOnTopOfTheScopeStillCounts(): void
|
||||
{
|
||||
$filterDto = (new TeamerFilterDto())
|
||||
->setAllSeason(true)
|
||||
->setName('Fromme')
|
||||
;
|
||||
|
||||
$this->assertSame(1, $filterDto->getActiveFiltersCount());
|
||||
$this->assertTrue($filterDto->isActive());
|
||||
}
|
||||
|
||||
public function testTheListIsUnscopedByDefault(): void
|
||||
{
|
||||
$this->assertFalse((new TeamerFilterDto())->isAllSeason());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user