users weekly stats as bar-chart in dashboard (#847)
This commit is contained in:
42
tests/Model/Statistic/DayTest.php
Normal file
42
tests/Model/Statistic/DayTest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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\Model\Statistic;
|
||||
|
||||
use App\Model\Statistic\Day;
|
||||
use DateTime;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Model\Statistic\Day
|
||||
*/
|
||||
class DayTest extends TestCase
|
||||
{
|
||||
public function testConstruct()
|
||||
{
|
||||
$date = new DateTime('-8 hours');
|
||||
$sut = new Day($date, 12340, 197.25956);
|
||||
|
||||
$this->assertSame($date, $sut->getDay());
|
||||
$this->assertEquals(12340, $sut->getTotalDuration());
|
||||
$this->assertEquals(197.25956, $sut->getTotalRate());
|
||||
}
|
||||
|
||||
public function testAllowedMonths()
|
||||
{
|
||||
$date = new DateTime('-8 hours');
|
||||
$sut = new Day($date, 12340, 197.25956);
|
||||
|
||||
$sut->setTotalDuration(999.27);
|
||||
$sut->setTotalRate(0.123456789);
|
||||
|
||||
$this->assertEquals(999, $sut->getTotalDuration());
|
||||
$this->assertEquals(0.123456789, $sut->getTotalRate());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user