Skip to content

Commit 9f39d6c

Browse files
committed
minor #42 fix PHPUnit compatibility (xabbuh)
This PR was merged into the 0.7.x-dev branch. Discussion ---------- fix PHPUnit compatibility Commits ------- 050b6cf fix PHPUnit compatibility
2 parents 2043853 + 050b6cf commit 9f39d6c

File tree

5 files changed

+16
-20
lines changed

5 files changed

+16
-20
lines changed

tests/Api/ActivityProfileApiClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ActivityProfileApiClientTest extends ApiClientTest
2929
*/
3030
private $client;
3131

32-
protected function setUp()
32+
protected function setUp(): void
3333
{
3434
parent::setUp();
3535
$this->client = new ActivityProfileApiClient(

tests/Api/AgentProfileApiClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class AgentProfileApiClientTest extends ApiClientTest
3131
*/
3232
private $client;
3333

34-
protected function setUp()
34+
protected function setUp(): void
3535
{
3636
parent::setUp();
3737
$this->client = new AgentProfileApiClient(

tests/Api/ApiClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ abstract class ApiClientTest extends TestCase
4343
*/
4444
protected $serializerRegistry;
4545

46-
protected function setUp()
46+
protected function setUp(): void
4747
{
4848
$this->requestHandler = $this->getMockBuilder(HandlerInterface::class)->getMock();
4949
$this->serializer = $this->getMockBuilder(SerializerInterface::class)->getMock();

tests/Api/StateApiClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class StateApiClientTest extends ApiClientTest
3232
*/
3333
private $client;
3434

35-
protected function setUp()
35+
protected function setUp(): void
3636
{
3737
parent::setUp();
3838
$this->client = new StateApiClient(

tests/Api/StatementsApiClientTest.php

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Xabbuh\XApi\Client\Tests\Api;
1313

1414
use Xabbuh\XApi\Client\Api\StatementsApiClient;
15+
use Xabbuh\XApi\Common\Exception\NotFoundException;
1516
use Xabbuh\XApi\DataFixtures\StatementFixtures;
1617
use Xabbuh\XApi\Model\Agent;
1718
use Xabbuh\XApi\Model\InverseFunctionalIdentifier;
@@ -37,7 +38,7 @@ class StatementsApiClientTest extends ApiClientTest
3738
*/
3839
private $client;
3940

40-
protected function setUp()
41+
protected function setUp(): void
4142
{
4243
parent::setUp();
4344
$this->client = new StatementsApiClient(
@@ -126,33 +127,30 @@ public function testStoreStatements()
126127
$this->assertEquals($statementId2, $statements[1]->getId()->getValue());
127128
}
128129

129-
/**
130-
* @expectedException \InvalidArgumentException
131-
*/
132130
public function testStoreStatementsWithNonStatementObject()
133131
{
132+
$this->expectException(\InvalidArgumentException::class);
133+
134134
$statement1 = $this->createStatement();
135135
$statement2 = $this->createStatement();
136136

137137
$this->client->storeStatements(array($statement1, new \stdClass(), $statement2));
138138
}
139139

140-
/**
141-
* @expectedException \InvalidArgumentException
142-
*/
143140
public function testStoreStatementsWithNonObject()
144141
{
142+
$this->expectException(\InvalidArgumentException::class);
143+
145144
$statement1 = $this->createStatement();
146145
$statement2 = $this->createStatement();
147146

148147
$this->client->storeStatements(array($statement1, 'foo', $statement2));
149148
}
150149

151-
/**
152-
* @expectedException \InvalidArgumentException
153-
*/
154150
public function testStoreStatementsWithId()
155151
{
152+
$this->expectException(\InvalidArgumentException::class);
153+
156154
$statement1 = $this->createStatement();
157155
$statement2 = $this->createStatement('12345678-1234-5678-1234-567812345679');
158156

@@ -202,11 +200,10 @@ public function testGetStatement()
202200
$this->client->getStatement(StatementId::fromString($statementId));
203201
}
204202

205-
/**
206-
* @expectedException \Xabbuh\XApi\Common\Exception\NotFoundException
207-
*/
208203
public function testGetStatementWithNotExistingStatement()
209204
{
205+
$this->expectException(NotFoundException::class);
206+
210207
$statementId = '12345678-1234-5678-1234-567812345678';
211208
$this->validateRetrieveApiCall(
212209
'get',
@@ -236,11 +233,10 @@ public function testGetVoidedStatement()
236233
$this->client->getVoidedStatement(StatementId::fromString($statementId));
237234
}
238235

239-
/**
240-
* @expectedException \Xabbuh\XApi\Common\Exception\NotFoundException
241-
*/
242236
public function testGetVoidedStatementWithNotExistingStatement()
243237
{
238+
$this->expectException(NotFoundException::class);
239+
244240
$statementId = '12345678-1234-5678-1234-567812345678';
245241
$this->validateRetrieveApiCall(
246242
'get',

0 commit comments

Comments
 (0)