Weekly reporting view (#1892)
This commit is contained in:
43
tests/Reporting/AbstractDateByUserTest.php
Normal file
43
tests/Reporting/AbstractDateByUserTest.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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\Reporting;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Reporting\DateByUser;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Reporting\DateByUser
|
||||
*/
|
||||
abstract class AbstractDateByUserTest extends TestCase
|
||||
{
|
||||
abstract protected function createSut(): DateByUser;
|
||||
|
||||
public function testEmptyObject()
|
||||
{
|
||||
$sut = $this->createSut();
|
||||
self::assertNull($sut->getDate());
|
||||
self::assertNull($sut->getUser());
|
||||
}
|
||||
|
||||
public function testSetter()
|
||||
{
|
||||
$date = new \DateTime('2019-05-27');
|
||||
$user = new User();
|
||||
$user->setAlias('sdfsdfdsdf');
|
||||
|
||||
$sut = $this->createSut();
|
||||
self::assertInstanceOf(DateByUser::class, $sut->setDate($date));
|
||||
self::assertInstanceOf(DateByUser::class, $sut->setUser($user));
|
||||
|
||||
self::assertSame($date, $sut->getDate());
|
||||
self::assertSame($user, $sut->getUser());
|
||||
}
|
||||
}
|
||||
25
tests/Reporting/MonthByUserTest.php
Normal file
25
tests/Reporting/MonthByUserTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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\Reporting;
|
||||
|
||||
use App\Reporting\DateByUser;
|
||||
use App\Reporting\MonthByUser;
|
||||
|
||||
/**
|
||||
* @covers \App\Reporting\MonthByUser
|
||||
* @covers \App\Reporting\DateByUser
|
||||
*/
|
||||
class MonthByUserTest extends AbstractDateByUserTest
|
||||
{
|
||||
protected function createSut(): DateByUser
|
||||
{
|
||||
return new MonthByUser();
|
||||
}
|
||||
}
|
||||
25
tests/Reporting/WeekByUserTest.php
Normal file
25
tests/Reporting/WeekByUserTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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\Reporting;
|
||||
|
||||
use App\Reporting\DateByUser;
|
||||
use App\Reporting\WeekByUser;
|
||||
|
||||
/**
|
||||
* @covers \App\Reporting\WeekByUser
|
||||
* @covers \App\Reporting\DateByUser
|
||||
*/
|
||||
class WeekByUserTest extends AbstractDateByUserTest
|
||||
{
|
||||
protected function createSut(): DateByUser
|
||||
{
|
||||
return new WeekByUser();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user