Files
kimai2/tests/Repository/Query/ExportQueryTest.php
Kevin Papst b6c98f871d Release 2.14 (#4710)
- show "link has expired message" in password reset screen
- added date objects as hydrator variables - for custom date formats in invoice templates
- show meta-fields with null values (e.g. booleans with `false` where hidden)
- fix permission check: allow to remove `view_own_timesheet` but still record times
- prevent error 500 if customer country is empty
- fix API 500 error if project does not exist when creating new timesheet
- fix tags are not created in remote-search mode
- do not check "export items" by default
- fix daterange query, if user an request locale are different
- added logging for invalid SAML responses (see various discussions)
2024-04-05 12:38:21 +02:00

59 lines
1.6 KiB
PHP

<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Tests\Repository\Query;
use App\Repository\Query\ExportQuery;
/**
* @covers \App\Repository\Query\ExportQuery
* @covers \App\Repository\Query\TimesheetQuery
*/
class ExportQueryTest extends TimesheetQueryTest
{
public function testQuery(): void
{
$sut = new ExportQuery();
$this->assertPage($sut);
$this->assertPageSize($sut);
$this->assertOrderBy($sut, 'begin');
$this->assertOrder($sut, ExportQuery::ORDER_ASC);
$this->assertUser($sut);
$this->assertCustomer($sut);
$this->assertProject($sut);
$this->assertActivity($sut);
$this->assertStateWith($sut, ExportQuery::STATE_STOPPED);
$this->assertExportedWith($sut, ExportQuery::STATE_NOT_EXPORTED);
$this->assertRenderer($sut);
$this->assertMarkAsExported($sut);
}
public function assertMarkAsExported(ExportQuery $sut): void
{
$this->assertFalse($sut->isMarkAsExported());
$sut->setMarkAsExported(true);
$this->assertTrue($sut->isMarkAsExported());
}
public function assertRenderer(ExportQuery $sut): void
{
$this->assertNull($sut->getRenderer());
$exportTypes = ['html', 'csv', 'pdf', 'xlsx', 'ods'];
foreach ($exportTypes as $type) {
$sut->setRenderer($type);
$this->assertEquals($type, $sut->getRenderer());
}
}
}