Files
kimai2/tests/TimesheetBundle/Repository/Query/TimesheetQueryTest.php
Kevin Papst 4e344dbe6e Create timesheet for User #31 (#47)
* added doctrine listener to calculate duration on each update #31
* added constraints to base objects #31
* new form to create timesheet entries #31
* added unit test for TimesheetVoter #31
2018-01-07 19:39:43 +01:00

43 lines
1.2 KiB
PHP

<?php
/*
* This file is part of the Kimai package.
*
* (c) Kevin Papst <kevin@kevinpapst.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace KimaiTest\TimesheetBundle\Repository\Query;
use AppBundle\Repository\Query\BaseQuery;
use \PHPUnit\Framework\TestCase;
use TimesheetBundle\Repository\Query\TimesheetQuery;
/**
* @covers \TimesheetBundle\Repository\Query\TimesheetQuery
* @author Kevin Papst <kevin@kevinpapst.de>
*/
class TimesheetQueryTest extends TestCase
{
public function testSetOrder()
{
$class = new \ReflectionClass(new BaseQuery());
$this->assertTrue($class->hasProperty('order'));
$this->assertTrue($class->hasProperty('orderBy'));
$sut = new TimesheetQuery();
$this->assertEquals(TimesheetQuery::ORDER_DESC, $sut->getOrder());
$this->assertEquals('begin', $sut->getOrderBy());
$sut->setOrder(TimesheetQuery::ORDER_ASC);
$sut->setOrderBy('id');
$this->assertEquals(TimesheetQuery::ORDER_ASC, $sut->getOrder());
$this->assertEquals('id', $sut->getOrderBy());
}
}