2828use Exchanger \Service \Xignite ;
2929use Exchanger \Service \RussianCentralBank ;
3030use Exchanger \Service \XchangeApi ;
31+ use Http \Discovery \NotFoundException ;
3132use Http \Mock \Client ;
3233use PHPUnit \Framework \TestCase ;
3334use Swap \Service \Factory ;
@@ -62,7 +63,7 @@ public function servicesProvider()
6263 ['xignite ' , Xignite::class, ['token ' => 'token ' ]],
6364 ['russian_central_bank ' , RussianCentralBank::class],
6465 ['cryptonator ' , Cryptonator::class],
65- ['xchangeapi ' , XchangeApi::class, ['api-key ' => 'api-key ' ]]
66+ ['xchangeapi ' , XchangeApi::class, ['api-key ' => 'api-key ' ]],
6667 ];
6768 }
6869
@@ -87,30 +88,30 @@ public function testCustomServices()
8788 $ this ->assertSame ($ service , $ factory ->create ('baz ' ));
8889 }
8990
90- /**
91- * @expectedException \LogicException
92- * @expectedExceptionMessage Client must be an instance of Http\Client\HttpClient or Psr\Http\Client\ClientInterface
93- */
9491 public function testConstructInvalidClient ()
9592 {
93+ $ this ->expectException (\LogicException::class);
94+ $ expectedExceptionMessage = 'Client must be an instance of Http\Client\HttpClient or Psr\Http\Client\ClientInterface ' ;
95+ $ this ->expectExceptionMessage ($ expectedExceptionMessage );
96+
9697 $ factory = new Factory (new \stdClass ());
9798 }
9899
99- /**
100- * @expectedException \Http\Discovery\NotFoundException
101- * @expectedExceptionMessage No HTTPlug clients found. Make sure to install a package providing "php-http/client-implementation"
102- */
103100 public function testWithNullAsClient ()
104101 {
102+ $ this ->expectException (NotFoundException::class);
103+ $ expectedExceptionMessage = 'No HTTPlug clients found. Make sure to install a package providing "php-http/client-implementation" ' ;
104+ $ this ->expectExceptionMessage ($ expectedExceptionMessage );
105+
105106 $ factory = new Factory ();
106107 }
107108
108- /**
109- * @expectedException \LogicException
110- * @expectedExceptionMessage Client must be an instance of Http\Client\HttpClient or Psr\Http\Client\ClientInterface
111- */
112109 public function testSetInvalidClient ()
113110 {
111+ $ this ->expectException (\LogicException::class);
112+ $ expectedExceptionMessage = 'Client must be an instance of Http\Client\HttpClient or Psr\Http\Client\ClientInterface ' ;
113+ $ this ->expectExceptionMessage ($ expectedExceptionMessage );
114+
114115 $ factory = new Factory (new Client ());
115116 $ factory ->setHttpClient (new \stdClass ());
116117 }
0 commit comments