1212namespace Xabbuh \XApi \Client \Tests \Api ;
1313
1414use Xabbuh \XApi \Client \Api \StatementsApiClient ;
15+ use Xabbuh \XApi \Common \Exception \NotFoundException ;
1516use Xabbuh \XApi \DataFixtures \StatementFixtures ;
1617use Xabbuh \XApi \Model \Agent ;
1718use 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