Skip to content

Commit a31c99d

Browse files
committed
fix tests
1 parent 8358b48 commit a31c99d

File tree

6 files changed

+35
-35
lines changed

6 files changed

+35
-35
lines changed

tests/Unit/Api/IssueCategory/ListTest.php renamed to tests/Unit/Api/IssueCategory/ListByProjectTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
use stdClass;
1111

1212
/**
13-
* Tests for IssueCategory::list()
13+
* Tests for IssueCategory::listByProject()
1414
*/
15-
class ListTest extends TestCase
15+
class ListByProjectTest extends TestCase
1616
{
1717
/**
18-
* @covers \Redmine\Api\IssueCategory::list
18+
* @covers \Redmine\Api\IssueCategory::listByProject
1919
*/
20-
public function testListWithoutParametersReturnsResponse()
20+
public function testListByProjectWithoutParametersReturnsResponse()
2121
{
2222
// Test values
2323
$projectId = 5;
@@ -43,13 +43,13 @@ public function testListWithoutParametersReturnsResponse()
4343
$api = new IssueCategory($client);
4444

4545
// Perform the tests
46-
$this->assertSame($expectedReturn, $api->list($projectId));
46+
$this->assertSame($expectedReturn, $api->listByProject($projectId));
4747
}
4848

4949
/**
50-
* @covers \Redmine\Api\IssueCategory::list
50+
* @covers \Redmine\Api\IssueCategory::listByProject
5151
*/
52-
public function testListWithParametersReturnsResponse()
52+
public function testListByProjectWithParametersReturnsResponse()
5353
{
5454
// Test values
5555
$projectId = 'project-slug';
@@ -79,22 +79,22 @@ public function testListWithParametersReturnsResponse()
7979
$api = new IssueCategory($client);
8080

8181
// Perform the tests
82-
$this->assertSame($expectedReturn, $api->list($projectId, $parameters));
82+
$this->assertSame($expectedReturn, $api->listByProject($projectId, $parameters));
8383
}
8484

8585
/**
86-
* @covers \Redmine\Api\IssueCategory::list
86+
* @covers \Redmine\Api\IssueCategory::listByProject
8787
*
8888
* @dataProvider getInvalidProjectIdentifiers
8989
*/
90-
public function testListWithWrongProjectIdentifierThrowsException($projectIdentifier)
90+
public function testListByProjectWithWrongProjectIdentifierThrowsException($projectIdentifier)
9191
{
9292
$api = new IssueCategory(MockClient::create());
9393

9494
$this->expectException(InvalidParameterException::class);
95-
$this->expectExceptionMessage('Redmine\Api\IssueCategory::list(): Argument #1 ($projectIdentifier) must be of type int or string');
95+
$this->expectExceptionMessage('Redmine\Api\IssueCategory::listByProject(): Argument #1 ($projectIdentifier) must be of type int or string');
9696

97-
$api->list($projectIdentifier);
97+
$api->listByProject($projectIdentifier);
9898
}
9999

100100
public static function getInvalidProjectIdentifiers(): array

tests/Unit/Api/IssueCategoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testAllTriggersDeprecationWarning()
2828
set_error_handler(
2929
function ($errno, $errstr): bool {
3030
$this->assertSame(
31-
'`Redmine\Api\IssueCategory::all()` is deprecated since v2.4.0, use `Redmine\Api\IssueCategory::list()` instead.',
31+
'`Redmine\Api\IssueCategory::all()` is deprecated since v2.4.0, use `Redmine\Api\IssueCategory::listByProject()` instead.',
3232
$errstr
3333
);
3434

tests/Unit/Api/IssueRelation/ListTest.php renamed to tests/Unit/Api/IssueRelation/ListByIssueIdTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
use Redmine\Client\Client;
88

99
/**
10-
* Tests for IssueRelation::list()
10+
* Tests for IssueRelation::listByIssueId()
1111
*/
12-
class ListTest extends TestCase
12+
class ListByIssueIdTest extends TestCase
1313
{
1414
/**
15-
* @covers \Redmine\Api\IssueRelation::list
15+
* @covers \Redmine\Api\IssueRelation::listByIssueId
1616
*/
17-
public function testListWithoutParametersReturnsResponse()
17+
public function testListByIssueIdWithoutParametersReturnsResponse()
1818
{
1919
// Test values
2020
$response = '["API Response"]';
@@ -39,13 +39,13 @@ public function testListWithoutParametersReturnsResponse()
3939
$api = new IssueRelation($client);
4040

4141
// Perform the tests
42-
$this->assertSame($expectedReturn, $api->list(5));
42+
$this->assertSame($expectedReturn, $api->listByIssueId(5));
4343
}
4444

4545
/**
46-
* @covers \Redmine\Api\IssuePriority::list
46+
* @covers \Redmine\Api\IssueRelation::listByIssueId
4747
*/
48-
public function testListWithParametersReturnsResponse()
48+
public function testListByIssueIdWithParametersReturnsResponse()
4949
{
5050
// Test values
5151
$parameters = ['not-used'];
@@ -74,6 +74,6 @@ public function testListWithParametersReturnsResponse()
7474
$api = new IssueRelation($client);
7575

7676
// Perform the tests
77-
$this->assertSame($expectedReturn, $api->list(5, $parameters));
77+
$this->assertSame($expectedReturn, $api->listByIssueId(5, $parameters));
7878
}
7979
}

tests/Unit/Api/IssueRelationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function testAllTriggersDeprecationWarning()
2727
set_error_handler(
2828
function ($errno, $errstr): bool {
2929
$this->assertSame(
30-
'`Redmine\Api\IssueRelation::all()` is deprecated since v2.4.0, use `Redmine\Api\IssueRelation::list()` instead.',
30+
'`Redmine\Api\IssueRelation::all()` is deprecated since v2.4.0, use `Redmine\Api\IssueRelation::listByIssueId()` instead.',
3131
$errstr
3232
);
3333

tests/Unit/Api/Membership/ListTest.php renamed to tests/Unit/Api/Membership/ListByProjectTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
use stdClass;
1111

1212
/**
13-
* Tests for Membership::list()
13+
* Tests for Membership::listByProject()
1414
*/
15-
class ListTest extends TestCase
15+
class ListByProjectTest extends TestCase
1616
{
1717
/**
18-
* @covers \Redmine\Api\Membership::list
18+
* @covers \Redmine\Api\Membership::listByProject
1919
*/
20-
public function testListWithoutParametersReturnsResponse()
20+
public function testListByProjectWithoutParametersReturnsResponse()
2121
{
2222
// Test values
2323
$response = '["API Response"]';
@@ -42,13 +42,13 @@ public function testListWithoutParametersReturnsResponse()
4242
$api = new Membership($client);
4343

4444
// Perform the tests
45-
$this->assertSame($expectedReturn, $api->list(5));
45+
$this->assertSame($expectedReturn, $api->listByProject(5));
4646
}
4747

4848
/**
49-
* @covers \Redmine\Api\Membership::list
49+
* @covers \Redmine\Api\Membership::listByProject
5050
*/
51-
public function testListWithParametersReturnsResponse()
51+
public function testListByProjectWithParametersReturnsResponse()
5252
{
5353
// Test values
5454
$parameters = ['not-used'];
@@ -77,22 +77,22 @@ public function testListWithParametersReturnsResponse()
7777
$api = new Membership($client);
7878

7979
// Perform the tests
80-
$this->assertSame($expectedReturn, $api->list('project-slug', $parameters));
80+
$this->assertSame($expectedReturn, $api->listByProject('project-slug', $parameters));
8181
}
8282

8383
/**
84-
* @covers \Redmine\Api\Membership::list
84+
* @covers \Redmine\Api\Membership::listByProject
8585
*
8686
* @dataProvider getInvalidProjectIdentifiers
8787
*/
88-
public function testListWithWrongProjectIdentifierThrowsException($projectIdentifier)
88+
public function testListByProjectWithWrongProjectIdentifierThrowsException($projectIdentifier)
8989
{
9090
$api = new Membership(MockClient::create());
9191

9292
$this->expectException(InvalidParameterException::class);
93-
$this->expectExceptionMessage('Redmine\Api\Membership::list(): Argument #1 ($projectIdentifier) must be of type int or string');
93+
$this->expectExceptionMessage('Redmine\Api\Membership::listByProject(): Argument #1 ($projectIdentifier) must be of type int or string');
9494

95-
$api->list($projectIdentifier);
95+
$api->listByProject($projectIdentifier);
9696
}
9797

9898
public static function getInvalidProjectIdentifiers(): array

tests/Unit/Api/MembershipTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testAllTriggersDeprecationWarning()
2929
set_error_handler(
3030
function ($errno, $errstr): bool {
3131
$this->assertSame(
32-
'`Redmine\Api\Membership::all()` is deprecated since v2.4.0, use `Redmine\Api\Membership::list()` instead.',
32+
'`Redmine\Api\Membership::all()` is deprecated since v2.4.0, use `Redmine\Api\Membership::listByProject()` instead.',
3333
$errstr
3434
);
3535

0 commit comments

Comments
 (0)