33namespace Redmine \Tests \Unit \Api \IssueCategory ;
44
55use PHPUnit \Framework \Attributes \CoversClass ;
6- use PHPUnit \Framework \Attributes \DataProvider ;
6+ use PHPUnit \Framework \Attributes \DataProviderExternal ;
77use PHPUnit \Framework \TestCase ;
88use Redmine \Api \IssueCategory ;
99use Redmine \Client \Client ;
1010use Redmine \Exception \InvalidParameterException ;
1111use Redmine \Exception \UnexpectedResponseException ;
1212use Redmine \Tests \Fixtures \MockClient ;
13- use stdClass ;
13+ use Redmine \ Tests \ Fixtures \ TestDataProvider ;
1414
1515#[CoversClass(IssueCategory::class)]
1616class ListByProjectTest extends TestCase
@@ -71,9 +71,9 @@ public function testListByProjectWithParametersReturnsResponse()
7171 }
7272
7373 /**
74- * @dataProvider getInvalidProjectIdentifiers
74+ * @dataProvider Redmine\Tests\Fixtures\TestDataProvider:: getInvalidProjectIdentifiers
7575 */
76- #[DataProvider( 'getInvalidProjectIdentifiers ' )]
76+ #[DataProviderExternal(TestDataProvider::class, 'getInvalidProjectIdentifiers ' )]
7777 public function testListByProjectWithWrongProjectIdentifierThrowsException ($ projectIdentifier )
7878 {
7979 $ api = new IssueCategory (MockClient::create ());
@@ -84,18 +84,6 @@ public function testListByProjectWithWrongProjectIdentifierThrowsException($proj
8484 $ api ->listByProject ($ projectIdentifier );
8585 }
8686
87- public static function getInvalidProjectIdentifiers (): array
88- {
89- return [
90- 'null ' => [null ],
91- 'true ' => [true ],
92- 'false ' => [false ],
93- 'float ' => [0.0 ],
94- 'array ' => [[]],
95- 'object ' => [new stdClass ()],
96- ];
97- }
98-
9987 public function testListByProjectThrowsException ()
10088 {
10189 // Create the used mock objects
0 commit comments