Release 2.12 (#4609)
This commit is contained in:
@@ -14,7 +14,7 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
abstract class AbstractTimesheetCountedStatisticTest extends TestCase
|
||||
{
|
||||
protected function assertDefaultValues(TimesheetCountedStatistic $sut)
|
||||
public function assertDefaultValues(TimesheetCountedStatistic $sut): void
|
||||
{
|
||||
self::assertSame(0.0, $sut->getRate());
|
||||
self::assertSame(0.0, $sut->getRate());
|
||||
@@ -55,7 +55,7 @@ abstract class AbstractTimesheetCountedStatisticTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
protected function assertSetter(TimesheetCountedStatistic $sut)
|
||||
public function assertSetter(TimesheetCountedStatistic $sut): void
|
||||
{
|
||||
$sut->setRate(23.97);
|
||||
$sut->setDuration(21);
|
||||
@@ -102,7 +102,7 @@ abstract class AbstractTimesheetCountedStatisticTest extends TestCase
|
||||
self::assertSame(987.12, $sut->getInternalRateBillable());
|
||||
}
|
||||
|
||||
protected function assertJsonSerialize(TimesheetCountedStatistic $sut)
|
||||
public function assertJsonSerialize(TimesheetCountedStatistic $sut): void
|
||||
{
|
||||
self::assertInstanceOf(\JsonSerializable::class, $sut);
|
||||
$sut->setRate(23.97);
|
||||
|
||||
@@ -36,7 +36,7 @@ class ActivityBudgetStatisticModelTest extends TestCase
|
||||
return new Activity();
|
||||
}
|
||||
|
||||
public function testAdditionals()
|
||||
public function testAdditionals(): void
|
||||
{
|
||||
$entity = $this->getEntity();
|
||||
$sut = $this->getSut($entity);
|
||||
|
||||
@@ -17,22 +17,22 @@ use App\Model\ActivityStatistic;
|
||||
*/
|
||||
class ActivityStatisticTest extends AbstractTimesheetCountedStatisticTest
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$this->assertDefaultValues(new ActivityStatistic());
|
||||
}
|
||||
|
||||
public function testSetter()
|
||||
public function testSetter(): void
|
||||
{
|
||||
$this->assertSetter(new ActivityStatistic());
|
||||
}
|
||||
|
||||
public function testJsonSerialize()
|
||||
public function testJsonSerialize(): void
|
||||
{
|
||||
$this->assertJsonSerialize(new ActivityStatistic());
|
||||
}
|
||||
|
||||
public function testAdditionalSetter()
|
||||
public function testAdditionalSetter(): void
|
||||
{
|
||||
$sut = new ActivityStatistic();
|
||||
self::assertNull($sut->getActivity());
|
||||
|
||||
@@ -30,22 +30,22 @@ class BudgetStatisticModelTest extends TestCase
|
||||
return new Customer('foo');
|
||||
}
|
||||
|
||||
public function testDefaults()
|
||||
public function testDefaults(): void
|
||||
{
|
||||
$this->assertDefaults();
|
||||
}
|
||||
|
||||
public function testSetter()
|
||||
public function testSetter(): void
|
||||
{
|
||||
$this->assertSetter();
|
||||
}
|
||||
|
||||
public function testCalculation()
|
||||
public function testCalculation(): void
|
||||
{
|
||||
$this->assertCalculation();
|
||||
}
|
||||
|
||||
protected function assertCalculation()
|
||||
protected function assertCalculation(): void
|
||||
{
|
||||
$entity = $this->getEntity();
|
||||
$entity->setBudget(100.0);
|
||||
@@ -112,7 +112,7 @@ class BudgetStatisticModelTest extends TestCase
|
||||
self::assertSame(213.00, $sut->getBudgetSpent());
|
||||
}
|
||||
|
||||
protected function assertSetter()
|
||||
protected function assertSetter(): void
|
||||
{
|
||||
$entity = $this->getEntity();
|
||||
$entity->setBudget(10.0);
|
||||
@@ -143,7 +143,7 @@ class BudgetStatisticModelTest extends TestCase
|
||||
self::assertNull($sut->getStatistic());
|
||||
}
|
||||
|
||||
protected function assertDefaults()
|
||||
protected function assertDefaults(): void
|
||||
{
|
||||
$entity = $this->getEntity();
|
||||
$sut = $this->getSut($entity);
|
||||
|
||||
@@ -36,7 +36,7 @@ class CustomerBudgetStatisticModelTest extends TestCase
|
||||
return new Customer('foo');
|
||||
}
|
||||
|
||||
public function testAdditionals()
|
||||
public function testAdditionals(): void
|
||||
{
|
||||
$entity = $this->getEntity();
|
||||
$sut = $this->getSut($entity);
|
||||
|
||||
@@ -16,17 +16,17 @@ use App\Model\CustomerStatistic;
|
||||
*/
|
||||
class CustomerStatisticTest extends AbstractTimesheetCountedStatisticTest
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$this->assertDefaultValues(new CustomerStatistic());
|
||||
}
|
||||
|
||||
public function testSetter()
|
||||
public function testSetter(): void
|
||||
{
|
||||
$this->assertSetter(new CustomerStatistic());
|
||||
}
|
||||
|
||||
public function testJsonSerialize()
|
||||
public function testJsonSerialize(): void
|
||||
{
|
||||
$this->assertJsonSerialize(new CustomerStatistic());
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class DailyStatisticTest extends TestCase
|
||||
{
|
||||
public function testStatistic()
|
||||
public function testStatistic(): void
|
||||
{
|
||||
$begin = new \DateTime('2018-04-07 12:00:00');
|
||||
$end = new \DateTime('2018-04-13 18:00:00');
|
||||
|
||||
@@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class MonthlyStatisticTest extends TestCase
|
||||
{
|
||||
public function testStatistic()
|
||||
public function testStatistic(): void
|
||||
{
|
||||
$begin = new \DateTime('2017-04-07 12:00:00');
|
||||
$end = new \DateTime('2019-11-13 18:00:00');
|
||||
|
||||
@@ -36,7 +36,7 @@ class ProjectBudgetStatisticModelTest extends TestCase
|
||||
return new Project();
|
||||
}
|
||||
|
||||
public function testAdditionals()
|
||||
public function testAdditionals(): void
|
||||
{
|
||||
$entity = $this->getEntity();
|
||||
$sut = $this->getSut($entity);
|
||||
|
||||
@@ -16,17 +16,17 @@ use App\Model\CustomerStatistic;
|
||||
*/
|
||||
class ProjectStatisticTest extends AbstractTimesheetCountedStatisticTest
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$this->assertDefaultValues(new CustomerStatistic());
|
||||
}
|
||||
|
||||
public function testSetter()
|
||||
public function testSetter(): void
|
||||
{
|
||||
$this->assertSetter(new CustomerStatistic());
|
||||
}
|
||||
|
||||
public function testJsonSerialize()
|
||||
public function testJsonSerialize(): void
|
||||
{
|
||||
$this->assertJsonSerialize(new CustomerStatistic());
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
abstract class AbstractTimesheetTest extends TestCase
|
||||
{
|
||||
protected function assertDefaultValues(Timesheet $sut)
|
||||
public function assertDefaultValues(Timesheet $sut): void
|
||||
{
|
||||
self::assertSame(0.0, $sut->getRate());
|
||||
self::assertSame(0, $sut->getDuration());
|
||||
@@ -25,7 +25,7 @@ abstract class AbstractTimesheetTest extends TestCase
|
||||
self::assertSame(0.0, $sut->getTotalInternalRate());
|
||||
}
|
||||
|
||||
protected function assertSetter(Timesheet $sut)
|
||||
public function assertSetter(Timesheet $sut): void
|
||||
{
|
||||
$sut->setTotalInternalRate(5485.84);
|
||||
$sut->setTotalRate(1234.23);
|
||||
|
||||
@@ -17,17 +17,17 @@ use App\Tests\Model\AbstractTimesheetCountedStatisticTest;
|
||||
*/
|
||||
class BudgetStatisticTest extends AbstractTimesheetCountedStatisticTest
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$this->assertDefaultValues(new BudgetStatistic());
|
||||
}
|
||||
|
||||
public function testSetter()
|
||||
public function testSetter(): void
|
||||
{
|
||||
$this->assertSetter(new BudgetStatistic());
|
||||
}
|
||||
|
||||
public function testJsonSerialize()
|
||||
public function testJsonSerialize(): void
|
||||
{
|
||||
$this->assertJsonSerialize(new BudgetStatistic());
|
||||
}
|
||||
|
||||
@@ -17,21 +17,21 @@ use DateTime;
|
||||
*/
|
||||
class DayTest extends AbstractTimesheetTest
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$date = new DateTime('-8 hours');
|
||||
$sut = new Day($date, 0, 0.0);
|
||||
$this->assertDefaultValues($sut);
|
||||
}
|
||||
|
||||
public function testSetter()
|
||||
public function testSetter(): void
|
||||
{
|
||||
$date = new DateTime('-8 hours');
|
||||
$sut = new Day($date, 12340, 197.25956);
|
||||
$this->assertSetter($sut);
|
||||
}
|
||||
|
||||
public function testConstruct()
|
||||
public function testConstruct(): void
|
||||
{
|
||||
$date = new DateTime('-8 hours');
|
||||
$sut = new Day($date, 12340, 197.25956);
|
||||
@@ -43,7 +43,7 @@ class DayTest extends AbstractTimesheetTest
|
||||
self::assertSame(0, $sut->getTotalDurationBillable());
|
||||
}
|
||||
|
||||
public function testAllowedMonths()
|
||||
public function testAllowedMonths(): void
|
||||
{
|
||||
$date = new DateTime('-8 hours');
|
||||
$sut = new Day($date, 12340, 197.25956);
|
||||
@@ -57,7 +57,7 @@ class DayTest extends AbstractTimesheetTest
|
||||
self::assertSame(12345, $sut->getTotalDurationBillable());
|
||||
}
|
||||
|
||||
public function testSetDetails()
|
||||
public function testSetDetails(): void
|
||||
{
|
||||
$sut = new Day(new DateTime(), 12340, 197.25956);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ use InvalidArgumentException;
|
||||
*/
|
||||
class MonthTest extends AbstractTimesheetTest
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new Month('01');
|
||||
$this->assertDefaultValues($sut);
|
||||
@@ -60,7 +60,7 @@ class MonthTest extends AbstractTimesheetTest
|
||||
/**
|
||||
* @dataProvider getTestData
|
||||
*/
|
||||
public function testAllowedMonths($init, $month, $number)
|
||||
public function testAllowedMonths($init, $month, $number): void
|
||||
{
|
||||
$sut = new Month($init);
|
||||
self::assertEquals($month, $sut->getMonth());
|
||||
@@ -79,14 +79,14 @@ class MonthTest extends AbstractTimesheetTest
|
||||
/**
|
||||
* @dataProvider getInvalidTestData
|
||||
*/
|
||||
public function testInvalidMonths($month)
|
||||
public function testInvalidMonths($month): void
|
||||
{
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Invalid month given. Expected 1-12, received "' . ((int) $month) . '".');
|
||||
new Month($month);
|
||||
}
|
||||
|
||||
public function testSetter()
|
||||
public function testSetter(): void
|
||||
{
|
||||
$sut = new Month('01');
|
||||
$this->assertSetter($sut);
|
||||
|
||||
@@ -17,7 +17,7 @@ use DateTime;
|
||||
*/
|
||||
class StatisticDateTest extends AbstractTimesheetTest
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$dateTime = new \DateTime('-8 hours');
|
||||
$sut = new StatisticDate($dateTime);
|
||||
@@ -28,14 +28,14 @@ class StatisticDateTest extends AbstractTimesheetTest
|
||||
self::assertEquals($dateTime->getTimestamp(), $sut->getDate()->getTimestamp());
|
||||
}
|
||||
|
||||
public function testSetter()
|
||||
public function testSetter(): void
|
||||
{
|
||||
$date = new DateTime('-8 hours');
|
||||
$sut = new StatisticDate($date);
|
||||
$this->assertSetter($sut);
|
||||
}
|
||||
|
||||
public function testAdditionalMethods()
|
||||
public function testAdditionalMethods(): void
|
||||
{
|
||||
$date = new DateTime('-8 hours');
|
||||
$sut = new StatisticDate($date);
|
||||
|
||||
@@ -16,13 +16,13 @@ use App\Model\Statistic\Timesheet;
|
||||
*/
|
||||
class TimesheetTest extends AbstractTimesheetTest
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new Timesheet();
|
||||
$this->assertDefaultValues($sut);
|
||||
}
|
||||
|
||||
public function testSetter()
|
||||
public function testSetter(): void
|
||||
{
|
||||
$sut = new Timesheet();
|
||||
$this->assertSetter($sut);
|
||||
|
||||
@@ -16,17 +16,17 @@ use App\Model\TimesheetCountedStatistic;
|
||||
*/
|
||||
class TimesheetCountedStatisticTest extends AbstractTimesheetCountedStatisticTest
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$this->assertDefaultValues(new TimesheetCountedStatistic());
|
||||
}
|
||||
|
||||
public function testSetter()
|
||||
public function testSetter(): void
|
||||
{
|
||||
$this->assertSetter(new TimesheetCountedStatistic());
|
||||
}
|
||||
|
||||
public function testJsonSerialize()
|
||||
public function testJsonSerialize(): void
|
||||
{
|
||||
$this->assertJsonSerialize(new TimesheetCountedStatistic());
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class TimesheetStatisticTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new TimesheetStatistic();
|
||||
$this->assertEquals(0, $sut->getRecordsTotal());
|
||||
@@ -27,7 +27,7 @@ class TimesheetStatisticTest extends TestCase
|
||||
$this->assertEquals(0, $sut->getDurationThisMonth());
|
||||
}
|
||||
|
||||
public function testSetter()
|
||||
public function testSetter(): void
|
||||
{
|
||||
$sut = new TimesheetStatistic();
|
||||
$sut->setRecordsTotal(2);
|
||||
|
||||
@@ -25,22 +25,22 @@ class UserStatisticTest extends AbstractTimesheetCountedStatisticTest
|
||||
return new UserStatistic($user);
|
||||
}
|
||||
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$this->assertDefaultValues($this->getSut());
|
||||
}
|
||||
|
||||
public function testSetter()
|
||||
public function testSetter(): void
|
||||
{
|
||||
$this->assertSetter($this->getSut());
|
||||
}
|
||||
|
||||
public function testJsonSerialize()
|
||||
public function testJsonSerialize(): void
|
||||
{
|
||||
$this->assertJsonSerialize($this->getSut());
|
||||
}
|
||||
|
||||
public function testAdditionalValues()
|
||||
public function testAdditionalValues(): void
|
||||
{
|
||||
$user = new User();
|
||||
$sut = new UserStatistic($user);
|
||||
|
||||
Reference in New Issue
Block a user