Release 2.6.0 (#4472)
- Added: calendar entry title combination for customer, project and activity - Added: show not_invoiced and not_exported data in detail screens - Added: force logout if user is disabled - Added: reduced amount of database queries on several screens - Fixed: open-close status on work-contract screen for users without configuration - Fixed: failsafe order/orderBy in query if manually manipulated to be null - Fixed: unify statistic calculation (not_invoiced and not_exported) across screens - Tech: bump packages - Tech: Symfony 6.4
This commit is contained in:
@@ -18,10 +18,15 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class PrepareUserEventTest extends TestCase
|
||||
{
|
||||
public function testGetterAndSetter()
|
||||
public function testGetterAndSetter(): void
|
||||
{
|
||||
$user = new User();
|
||||
$sut = new PrepareUserEvent($user);
|
||||
$this->assertSame($user, $sut->getUser());
|
||||
$this->assertTrue($sut->isBooting());
|
||||
|
||||
$sut = new PrepareUserEvent($user, false);
|
||||
$this->assertSame($user, $sut->getUser());
|
||||
$this->assertFalse($sut->isBooting());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class UserPreferenceEventTest extends TestCase
|
||||
{
|
||||
public function testGetterAndSetter()
|
||||
public function testGetterAndSetter(): void
|
||||
{
|
||||
$user = new User();
|
||||
$user->setAlias('foo');
|
||||
@@ -28,14 +28,18 @@ class UserPreferenceEventTest extends TestCase
|
||||
$sut = new UserPreferenceEvent($user, []);
|
||||
|
||||
$this->assertEquals($user, $sut->getUser());
|
||||
$this->assertTrue($sut->isBooting());
|
||||
$this->assertEquals([], $sut->getPreferences());
|
||||
|
||||
$sut->addPreference($pref);
|
||||
|
||||
$this->assertEquals([$pref], $sut->getPreferences());
|
||||
|
||||
$sut = new UserPreferenceEvent($user, [], false);
|
||||
$this->assertFalse($sut->isBooting());
|
||||
}
|
||||
|
||||
public function testDuplicatePreferenceThrowsException()
|
||||
public function testDuplicatePreferenceThrowsException(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
namespace App\Tests\Reporting\ProjectView;
|
||||
|
||||
use App\Entity\Project;
|
||||
use App\Model\ProjectBudgetStatisticModel;
|
||||
use App\Model\Statistic\BudgetStatistic;
|
||||
use App\Reporting\ProjectView\ProjectViewModel;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
@@ -18,10 +20,13 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class ProjectViewModelTest extends TestCase
|
||||
{
|
||||
public function testDefaults()
|
||||
public function testDefaults(): void
|
||||
{
|
||||
$project = new Project();
|
||||
$sut = new ProjectViewModel($project);
|
||||
$model = new ProjectBudgetStatisticModel($project);
|
||||
$total = new BudgetStatistic();
|
||||
$model->setStatisticTotal($total);
|
||||
$sut = new ProjectViewModel($model);
|
||||
|
||||
self::assertSame($project, $sut->getProject());
|
||||
self::assertSame(0, $sut->getDurationDay());
|
||||
@@ -32,27 +37,33 @@ class ProjectViewModelTest extends TestCase
|
||||
self::assertSame(0.0, $sut->getNotExportedRate());
|
||||
self::assertSame(0.0, $sut->getRateTotal());
|
||||
self::assertNull($sut->getLastRecord());
|
||||
self::assertSame(0, $sut->getTimesheetCounter());
|
||||
self::assertNull($sut->getLastRecord());
|
||||
self::assertSame(0.0, $sut->getBillableRate());
|
||||
self::assertSame(0, $sut->getBillableDuration());
|
||||
self::assertSame(0, $sut->getNotBilledDuration());
|
||||
self::assertSame(0.0, $sut->getNotBilledRate());
|
||||
}
|
||||
|
||||
public function testSetterGetter()
|
||||
public function testSetterGetter(): void
|
||||
{
|
||||
$sut = new ProjectViewModel(new Project());
|
||||
$project = new Project();
|
||||
|
||||
$model = new ProjectBudgetStatisticModel($project);
|
||||
$total = new BudgetStatistic();
|
||||
$total->setCounter(123);
|
||||
$total->setDuration(3456789);
|
||||
$total->setDurationBillable(3456789);
|
||||
$total->setDurationBillableExported(3400000);
|
||||
$total->setRate(789.0);
|
||||
$total->setRateBillable(16789.0);
|
||||
$total->setRateBillableExported(10000.0);
|
||||
$model->setStatisticTotal($total);
|
||||
|
||||
$sut = new ProjectViewModel($model);
|
||||
|
||||
$date = new \DateTime();
|
||||
|
||||
$sut->setDurationDay(123456789);
|
||||
$sut->setDurationMonth(23456789);
|
||||
$sut->setDurationTotal(3456789);
|
||||
$sut->setDurationWeek(456789);
|
||||
$sut->setNotExportedDuration(56789);
|
||||
$sut->setNotExportedRate(6789);
|
||||
$sut->setRateTotal(789);
|
||||
$sut->setLastRecord($date);
|
||||
|
||||
self::assertSame(123456789, $sut->getDurationDay());
|
||||
@@ -65,18 +76,10 @@ class ProjectViewModelTest extends TestCase
|
||||
self::assertSame($date, $sut->getLastRecord());
|
||||
|
||||
$date = new \DateTime();
|
||||
$sut->setTimesheetCounter(123);
|
||||
$sut->setLastRecord($date);
|
||||
$sut->setBillableRate(123.456);
|
||||
$sut->setBillableDuration(321);
|
||||
$sut->setNotBilledDuration(9876);
|
||||
$sut->setNotBilledRate(4705.23);
|
||||
|
||||
self::assertSame(123, $sut->getTimesheetCounter());
|
||||
self::assertSame($date, $sut->getLastRecord());
|
||||
self::assertSame(123.456, $sut->getBillableRate());
|
||||
self::assertSame(321, $sut->getBillableDuration());
|
||||
self::assertSame(9876, $sut->getNotBilledDuration());
|
||||
self::assertSame(4705.23, $sut->getNotBilledRate());
|
||||
self::assertSame(16789.0, $sut->getBillableRate());
|
||||
self::assertSame(3456789, $sut->getBillableDuration());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4477,11 +4477,6 @@ parameters:
|
||||
count: 5
|
||||
path: Event/PermissionsEventTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Event\\\\PrepareUserEventTest\\:\\:testGetterAndSetter\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: Event/PrepareUserEventTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Event\\\\ProjectBudgetStatisticEventTest\\:\\:testStatistic\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
@@ -4607,16 +4602,6 @@ parameters:
|
||||
count: 1
|
||||
path: Event/UserPreferenceDisplayEventTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Event\\\\UserPreferenceEventTest\\:\\:testDuplicatePreferenceThrowsException\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: Event/UserPreferenceEventTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Event\\\\UserPreferenceEventTest\\:\\:testGetterAndSetter\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: Event/UserPreferenceEventTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Event\\\\UserRevenueStatisticEventTest\\:\\:testDefaultValues\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
@@ -7137,16 +7122,6 @@ parameters:
|
||||
count: 1
|
||||
path: Reporting/ProjectInactive/ProjectInactiveQueryTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Reporting\\\\ProjectView\\\\ProjectViewModelTest\\:\\:testDefaults\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: Reporting/ProjectView/ProjectViewModelTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Reporting\\\\ProjectView\\\\ProjectViewModelTest\\:\\:testSetterGetter\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: Reporting/ProjectView/ProjectViewModelTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Reporting\\\\ProjectView\\\\ProjectViewQueryTest\\:\\:testDefaults\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
@@ -8457,11 +8432,6 @@ parameters:
|
||||
count: 1
|
||||
path: TranslationsTest.php
|
||||
|
||||
-
|
||||
message: "#^Offset 'target\\-language' does not exist on SimpleXMLElement\\|null\\.$#"
|
||||
count: 1
|
||||
path: TranslationsTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Twig\\\\ContextTest\\:\\:getDefaultSettings\\(\\) return type has no value type specified in iterable type array\\.$#"
|
||||
count: 1
|
||||
|
||||
Reference in New Issue
Block a user