replace PHPUnit annotations with attributes (#5608)
This commit is contained in:
@@ -11,10 +11,9 @@ namespace App\Tests\Model\Statistic;
|
||||
|
||||
use App\Model\Statistic\BudgetStatistic;
|
||||
use App\Tests\Model\AbstractTimesheetCountedStatisticTestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/**
|
||||
* @covers \App\Model\Statistic\BudgetStatistic
|
||||
*/
|
||||
#[CoversClass(BudgetStatistic::class)]
|
||||
class BudgetStatisticTest extends AbstractTimesheetCountedStatisticTestCase
|
||||
{
|
||||
public function testDefaultValues(): void
|
||||
|
||||
@@ -11,10 +11,9 @@ namespace App\Tests\Model\Statistic;
|
||||
|
||||
use App\Model\Statistic\Day;
|
||||
use DateTime;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/**
|
||||
* @covers \App\Model\Statistic\Day
|
||||
*/
|
||||
#[CoversClass(Day::class)]
|
||||
class DayTest extends AbstractTimesheetTestCase
|
||||
{
|
||||
public function testDefaultValues(): void
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace App\Tests\Model\Statistic;
|
||||
|
||||
use App\Model\Statistic\Month;
|
||||
use InvalidArgumentException;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
/**
|
||||
* @covers \App\Model\Statistic\Month
|
||||
*/
|
||||
#[CoversClass(Month::class)]
|
||||
class MonthTest extends AbstractTimesheetTestCase
|
||||
{
|
||||
public function testDefaultValues(): void
|
||||
@@ -57,9 +57,7 @@ class MonthTest extends AbstractTimesheetTestCase
|
||||
yield [12, '12', 12];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getTestData
|
||||
*/
|
||||
#[DataProvider('getTestData')]
|
||||
public function testAllowedMonths($init, $month, $number): void
|
||||
{
|
||||
$sut = new Month($init);
|
||||
@@ -76,9 +74,7 @@ class MonthTest extends AbstractTimesheetTestCase
|
||||
yield [19];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getInvalidTestData
|
||||
*/
|
||||
#[DataProvider('getInvalidTestData')]
|
||||
public function testInvalidMonths($month): void
|
||||
{
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
|
||||
@@ -11,10 +11,9 @@ namespace App\Tests\Model\Statistic;
|
||||
|
||||
use App\Model\Statistic\StatisticDate;
|
||||
use DateTime;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/**
|
||||
* @covers \App\Model\Statistic\StatisticDate
|
||||
*/
|
||||
#[CoversClass(StatisticDate::class)]
|
||||
class StatisticDateTest extends AbstractTimesheetTestCase
|
||||
{
|
||||
public function testDefaultValues(): void
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
namespace App\Tests\Model\Statistic;
|
||||
|
||||
use App\Model\Statistic\Timesheet;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
/**
|
||||
* @covers \App\Model\Statistic\Timesheet
|
||||
*/
|
||||
#[CoversClass(Timesheet::class)]
|
||||
class TimesheetTest extends AbstractTimesheetTestCase
|
||||
{
|
||||
public function testDefaultValues(): void
|
||||
|
||||
@@ -11,11 +11,10 @@ namespace App\Tests\Model\Statistic;
|
||||
|
||||
use App\Model\Statistic\Month;
|
||||
use App\Model\Statistic\Year;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Model\Statistic\Year
|
||||
*/
|
||||
#[CoversClass(Year::class)]
|
||||
class YearTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues(): void
|
||||
|
||||
Reference in New Issue
Block a user