Files
kimai2/tests/Repository/Query/InvoiceQueryTest.php
Kevin Papst f8cb8900d6 Release 1.20.3 (#3340)
* fix edit timesheet link
* fix drag & drop creates record for wrong user
* fix search with multiple bindings
* hide user switcher in calendar if there is only one user to choose
* make quick entry responsive for mobile-only users
* mark invoices as exported by default
* fix serialization deprecation warning
* fix duration calculation for fixed rate entries
* updated composer packages
* fix checkbox for horizontal forms
* support pdfContext for PDF invoice templates
2022-06-11 13:25:50 +02:00

60 lines
1.7 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\InvoiceQuery;
/**
* @covers \App\Repository\Query\InvoiceQuery
* @covers \App\Repository\Query\TimesheetQuery
*/
class InvoiceQueryTest extends TimesheetQueryTest
{
public function testQuery()
{
$sut = new InvoiceQuery();
$this->assertPage($sut);
$this->assertPageSize($sut);
$this->assertOrderBy($sut, 'begin');
$this->assertOrder($sut, InvoiceQuery::ORDER_ASC);
$this->assertUser($sut);
$this->assertCustomer($sut);
$this->assertProject($sut);
$this->assertActivity($sut);
self::assertEquals(InvoiceQuery::STATE_STOPPED, $sut->getState());
self::assertFalse($sut->isRunning());
self::assertTrue($sut->isStopped());
$this->assertExportedWith($sut, InvoiceQuery::STATE_NOT_EXPORTED);
$this->assertMarkAsExported($sut);
$this->assertModifiedAfter($sut);
self::assertTrue($sut->getBillable());
self::assertTrue($sut->isBillable());
self::assertFalse($sut->isNotBillable());
self::assertFalse($sut->isIgnoreBillable());
self::assertTrue($sut->isBillable());
self::assertFalse($sut->isNotBillable());
$this->assertBillable($sut);
}
protected function assertMarkAsExported(InvoiceQuery $sut)
{
self::assertTrue($sut->isMarkAsExported());
$sut->setMarkAsExported(false);
self::assertFalse($sut->isMarkAsExported());
}
}