12
12
namespace Xabbuh \XApi \Client \Tests \Api ;
13
13
14
14
use Xabbuh \XApi \Client \Api \StatementsApiClient ;
15
+ use Xabbuh \XApi \Common \Exception \NotFoundException ;
15
16
use Xabbuh \XApi \DataFixtures \StatementFixtures ;
16
17
use Xabbuh \XApi \Model \Agent ;
17
18
use Xabbuh \XApi \Model \InverseFunctionalIdentifier ;
@@ -37,7 +38,7 @@ class StatementsApiClientTest extends ApiClientTest
37
38
*/
38
39
private $ client ;
39
40
40
- protected function setUp ()
41
+ protected function setUp (): void
41
42
{
42
43
parent ::setUp ();
43
44
$ this ->client = new StatementsApiClient (
@@ -126,33 +127,30 @@ public function testStoreStatements()
126
127
$ this ->assertEquals ($ statementId2 , $ statements [1 ]->getId ()->getValue ());
127
128
}
128
129
129
- /**
130
- * @expectedException \InvalidArgumentException
131
- */
132
130
public function testStoreStatementsWithNonStatementObject ()
133
131
{
132
+ $ this ->expectException (\InvalidArgumentException::class);
133
+
134
134
$ statement1 = $ this ->createStatement ();
135
135
$ statement2 = $ this ->createStatement ();
136
136
137
137
$ this ->client ->storeStatements (array ($ statement1 , new \stdClass (), $ statement2 ));
138
138
}
139
139
140
- /**
141
- * @expectedException \InvalidArgumentException
142
- */
143
140
public function testStoreStatementsWithNonObject ()
144
141
{
142
+ $ this ->expectException (\InvalidArgumentException::class);
143
+
145
144
$ statement1 = $ this ->createStatement ();
146
145
$ statement2 = $ this ->createStatement ();
147
146
148
147
$ this ->client ->storeStatements (array ($ statement1 , 'foo ' , $ statement2 ));
149
148
}
150
149
151
- /**
152
- * @expectedException \InvalidArgumentException
153
- */
154
150
public function testStoreStatementsWithId ()
155
151
{
152
+ $ this ->expectException (\InvalidArgumentException::class);
153
+
156
154
$ statement1 = $ this ->createStatement ();
157
155
$ statement2 = $ this ->createStatement ('12345678-1234-5678-1234-567812345679 ' );
158
156
@@ -202,11 +200,10 @@ public function testGetStatement()
202
200
$ this ->client ->getStatement (StatementId::fromString ($ statementId ));
203
201
}
204
202
205
- /**
206
- * @expectedException \Xabbuh\XApi\Common\Exception\NotFoundException
207
- */
208
203
public function testGetStatementWithNotExistingStatement ()
209
204
{
205
+ $ this ->expectException (NotFoundException::class);
206
+
210
207
$ statementId = '12345678-1234-5678-1234-567812345678 ' ;
211
208
$ this ->validateRetrieveApiCall (
212
209
'get ' ,
@@ -236,11 +233,10 @@ public function testGetVoidedStatement()
236
233
$ this ->client ->getVoidedStatement (StatementId::fromString ($ statementId ));
237
234
}
238
235
239
- /**
240
- * @expectedException \Xabbuh\XApi\Common\Exception\NotFoundException
241
- */
242
236
public function testGetVoidedStatementWithNotExistingStatement ()
243
237
{
238
+ $ this ->expectException (NotFoundException::class);
239
+
244
240
$ statementId = '12345678-1234-5678-1234-567812345678 ' ;
245
241
$ this ->validateRetrieveApiCall (
246
242
'get ' ,
0 commit comments