Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add void return type in tests
  • Loading branch information
Art4 committed Jul 10, 2024
commit 01f5fe573cbbbfc7ee96b83fab2399b90da1a8c2
2 changes: 1 addition & 1 deletion tests/Integration/IssueCategoryXmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class IssueCategoryXmlTest extends TestCase
{
public function testCreateBlank()
public function testCreateBlank(): void
{
/** @var \Redmine\Api\IssueCategory */
$api = MockClient::create()->getApi('issue_category');
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Psr18ClientRequestGenerationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testPsr18ClientCreatesCorrectRequests(
string $path,
$data,
$expectedOutput
) {
): void {
$response = $this->createMock(ResponseInterface::class);

/** @var ClientInterface|\PHPUnit\Framework\MockObject\MockObject */
Expand Down
38 changes: 19 additions & 19 deletions tests/Integration/UrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class UrlTest extends TestCase
{
public function testAttachment()
public function testAttachment(): void
{
/** @var \Redmine\Api\Attachment */
$api = MockClient::create()->getApi('attachment');
Expand All @@ -17,7 +17,7 @@ public function testAttachment()
$this->assertEquals('GET', $res['method']);
}

public function testCustomFields()
public function testCustomFields(): void
{
/** @var \Redmine\Api\CustomField */
$api = MockClient::create()->getApi('custom_fields');
Expand All @@ -27,7 +27,7 @@ public function testCustomFields()
$this->assertEquals('GET', $res['method']);
}

public function testGroup()
public function testGroup(): void
{
/** @var \Redmine\Api\Group */
$api = MockClient::create()->getApi('group');
Expand Down Expand Up @@ -55,7 +55,7 @@ public function testGroup()
$this->assertEquals('DELETE', $res['method']);
}

public function testIssue()
public function testIssue(): void
{
/** @var \Redmine\Api\Issue */
$api = MockClient::create()->getApi('issue');
Expand Down Expand Up @@ -85,7 +85,7 @@ public function testIssue()
// $this->assertEquals($res, array('path' => '/issues/1.xml', 'method' => 'DELETE'));
}

public function testIssueCategory()
public function testIssueCategory(): void
{
/** @var \Redmine\Api\IssueCategory */
$api = MockClient::create()->getApi('issue_category');
Expand Down Expand Up @@ -113,7 +113,7 @@ public function testIssueCategory()
$this->assertEquals('DELETE', $res['method']);
}

public function testIssuePriority()
public function testIssuePriority(): void
{
/** @var \Redmine\Api\IssuePriority */
$api = MockClient::create()->getApi('issue_priority');
Expand All @@ -123,7 +123,7 @@ public function testIssuePriority()
$this->assertEquals('GET', $res['method']);
}

public function testIssueRelation()
public function testIssueRelation(): void
{
/** @var \Redmine\Api\IssueRelation */
$api = MockClient::create()->getApi('issue_relation');
Expand All @@ -142,7 +142,7 @@ public function testIssueRelation()
$this->assertEquals('DELETE', $res['method']);
}

public function testIssueStatus()
public function testIssueStatus(): void
{
/** @var \Redmine\Api\IssueStatus */
$api = MockClient::create()->getApi('issue_status');
Expand All @@ -152,7 +152,7 @@ public function testIssueStatus()
$this->assertEquals('GET', $res['method']);
}

public function testMembership()
public function testMembership(): void
{
/** @var \Redmine\Api\Membership */
$api = MockClient::create()->getApi('membership');
Expand All @@ -169,7 +169,7 @@ public function testMembership()
$this->assertEquals('DELETE', $res['method']);
}

public function testNews()
public function testNews(): void
{
/** @var \Redmine\Api\News */
$api = MockClient::create()->getApi('news');
Expand All @@ -184,7 +184,7 @@ public function testNews()
$this->assertEquals('GET', $res['method']);
}

public function testProject()
public function testProject(): void
{
/** @var \Redmine\Api\Project */
$api = MockClient::create()->getApi('project');
Expand All @@ -206,7 +206,7 @@ public function testProject()
$this->assertEquals('DELETE', $res['method']);
}

public function testQuery()
public function testQuery(): void
{
/** @var \Redmine\Api\Query */
$api = MockClient::create()->getApi('query');
Expand All @@ -216,7 +216,7 @@ public function testQuery()
$this->assertEquals('GET', $res['method']);
}

public function testRole()
public function testRole(): void
{
/** @var \Redmine\Api\Role */
$api = MockClient::create()->getApi('role');
Expand All @@ -231,7 +231,7 @@ public function testRole()
$this->assertEquals('GET', $res['method']);
}

public function testTimeEntry()
public function testTimeEntry(): void
{
/** @var \Redmine\Api\TimeEntry */
$api = MockClient::create()->getApi('time_entry');
Expand Down Expand Up @@ -267,7 +267,7 @@ public function testTimeEntry()
$this->assertEquals('DELETE', $res['method']);
}

public function testTimeEntryActivity()
public function testTimeEntryActivity(): void
{
/** @var \Redmine\Api\TimeEntryActivity */
$api = MockClient::create()->getApi('time_entry_activity');
Expand All @@ -277,7 +277,7 @@ public function testTimeEntryActivity()
$this->assertEquals('GET', $res['method']);
}

public function testTracker()
public function testTracker(): void
{
/** @var \Redmine\Api\Tracker */
$api = MockClient::create()->getApi('tracker');
Expand All @@ -287,7 +287,7 @@ public function testTracker()
$this->assertEquals('GET', $res['method']);
}

public function testUser()
public function testUser(): void
{
/** @var \Redmine\Api\User */
$api = MockClient::create()->getApi('user');
Expand Down Expand Up @@ -324,7 +324,7 @@ public function testUser()
$this->assertEquals('DELETE', $res['method']);
}

public function testVersion()
public function testVersion(): void
{
/** @var \Redmine\Api\Version */
$api = MockClient::create()->getApi('version');
Expand All @@ -346,7 +346,7 @@ public function testVersion()
$this->assertEquals('DELETE', $res['method']);
}

public function testWiki()
public function testWiki(): void
{
/** @var \Redmine\Api\Wiki */
$api = MockClient::create()->getApi('wiki');
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/UserXmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class UserXmlTest extends TestCase
{
public function testCreateBlank()
public function testCreateBlank(): void
{
/** @var \Redmine\Api\User */
$api = MockClient::create()->getApi('user');
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Api/AbstractApi/DeleteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#[CoversClass(AbstractApi::class)]
class DeleteTest extends TestCase
{
public function testDeleteWithHttpClient()
public function testDeleteWithHttpClient(): void
{
$client = AssertingHttpClient::create(
$this,
Expand Down Expand Up @@ -45,7 +45,7 @@ public function testDeleteWithHttpClient()
* @dataProvider getXmlDecodingFromDeleteMethodData
*/
#[DataProvider('getXmlDecodingFromDeleteMethodData')]
public function testXmlDecodingFromDeleteMethod($response, $expected)
public function testXmlDecodingFromDeleteMethod($response, $expected): void
{
$client = $this->createMock(Client::class);
$client->method('getLastResponseBody')->willReturn($response);
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/Api/AbstractApi/GetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#[CoversClass(AbstractApi::class)]
class GetTest extends TestCase
{
public function testGetWithHttpClient()
public function testGetWithHttpClient(): void
{
$client = AssertingHttpClient::create(
$this,
Expand Down Expand Up @@ -47,7 +47,7 @@ public function testGetWithHttpClient()
* @dataProvider getJsonDecodingFromGetMethodData
*/
#[DataProvider('getJsonDecodingFromGetMethodData')]
public function testJsonDecodingFromGetMethod($response, $decode, $expected)
public function testJsonDecodingFromGetMethod($response, $decode, $expected): void
{
$client = $this->createMock(Client::class);
$client->method('getLastResponseBody')->willReturn($response);
Expand Down Expand Up @@ -82,7 +82,7 @@ public static function getJsonDecodingFromGetMethodData(): array
* @dataProvider getXmlDecodingFromGetMethodData
*/
#[DataProvider('getXmlDecodingFromGetMethodData')]
public function testXmlDecodingFromGetMethod($response, $decode, $expected)
public function testXmlDecodingFromGetMethod($response, $decode, $expected): void
{
$client = $this->createMock(Client::class);
$client->method('getLastResponseBody')->willReturn($response);
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Api/AbstractApi/PostTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#[CoversClass(AbstractApi::class)]
class PostTest extends TestCase
{
public function testPostWithHttpClient()
public function testPostWithHttpClient(): void
{
$client = AssertingHttpClient::create(
$this,
Expand Down Expand Up @@ -47,7 +47,7 @@ public function testPostWithHttpClient()
* @dataProvider getXmlDecodingFromPostMethodData
*/
#[DataProvider('getXmlDecodingFromPostMethodData')]
public function testXmlDecodingFromPostMethod($response, $expected)
public function testXmlDecodingFromPostMethod($response, $expected): void
{
$client = $this->createMock(Client::class);
$client->method('getLastResponseBody')->willReturn($response);
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Api/AbstractApi/PutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#[CoversClass(AbstractApi::class)]
class PutTest extends TestCase
{
public function testPutWithHttpClient()
public function testPutWithHttpClient(): void
{
$client = AssertingHttpClient::create(
$this,
Expand Down Expand Up @@ -47,7 +47,7 @@ public function testPutWithHttpClient()
* @dataProvider getXmlDecodingFromPutMethodData
*/
#[DataProvider('getXmlDecodingFromPutMethodData')]
public function testXmlDecodingFromPutMethod($response, $expected)
public function testXmlDecodingFromPutMethod($response, $expected): void
{
$client = $this->createMock(Client::class);
$client->method('getLastResponseBody')->willReturn($response);
Expand Down
Loading