44
55use Bigcommerce \Api \Client ;
66use Bigcommerce \Api \Connection ;
7+ use PHPUnit \Framework \TestCase ;
78
8- class ClientTest extends \PHPUnit_Framework_TestCase
9+ class ClientTest extends TestCase
910{
1011 /**
1112 * @var Connection|\PHPUnit_Framework_MockObject_MockObject
@@ -52,19 +53,22 @@ public function tearDown()
5253
5354 public function testConfigureRequiresStoreUrl ()
5455 {
55- $ this ->setExpectedException ('\\Exception ' , "'store_url' must be provided " );
56+ $ this ->expectException ('\\Exception ' );
57+ $ this ->expectExceptionMessage ("'store_url' must be provided " );
5658 Client::configure (array ('username ' => 'whatever ' , 'api_key ' => 'whatever ' ));
5759 }
5860
5961 public function testConfigureRequiresUsername ()
6062 {
61- $ this ->setExpectedException ('\\Exception ' , "'username' must be provided " );
63+ $ this ->expectException ('\\Exception ' );
64+ $ this ->expectExceptionMessage ("'username' must be provided " );
6265 Client::configure (array ('store_url ' => 'whatever ' , 'api_key ' => 'whatever ' ));
6366 }
6467
6568 public function testConfigureRequiresApiKey ()
6669 {
67- $ this ->setExpectedException ('\\Exception ' , "'api_key' must be provided " );
70+ $ this ->expectException ('\\Exception ' );
71+ $ this ->expectExceptionMessage ("'api_key' must be provided " );
6872 Client::configure (array ('username ' => 'whatever ' , 'store_url ' => 'whatever ' ));
6973 }
7074
@@ -144,7 +148,8 @@ public function testGetCustomerLoginTokenThrowsIfNoClientSecret()
144148 'auth_token ' => 'def ' ,
145149 'store_hash ' => 'abc '
146150 ));
147- $ this ->setExpectedException ('\Exception ' , 'Cannot sign customer login tokens without a client secret ' );
151+ $ this ->expectException ('\Exception ' );
152+ $ this ->expectExceptionMessage ('Cannot sign customer login tokens without a client secret ' );
148153 Client::getCustomerLoginToken (1 );
149154 }
150155
@@ -852,8 +857,8 @@ public function testDeletingAllGiftCertificatesDeletesToTheAllGiftCertificatesRe
852857
853858 Client::deleteAllGiftCertificates ();
854859 }
855-
856-
860+
861+
857862 public function testGettingWebhooksReturnsAllWebhooks ()
858863 {
859864 $ this ->connection ->expects ($ this ->once ())
@@ -866,7 +871,7 @@ public function testGettingWebhooksReturnsAllWebhooks()
866871 $ this ->assertInstanceOf ('Bigcommerce \\Api \\Resource ' , $ resource );
867872 }
868873 }
869-
874+
870875 public function testGettingSpecifiedWebhookReturnsTheSpecifiedWebhook ()
871876 {
872877 $ this ->connection ->expects ($ this ->once ())
@@ -876,7 +881,7 @@ public function testGettingSpecifiedWebhookReturnsTheSpecifiedWebhook()
876881 $ resource = Client::getWebhook (1 );
877882 $ this ->assertInstanceOf ('Bigcommerce \\Api \\Resource ' , $ resource );
878883 }
879-
884+
880885 public function testCreatingWebhookPostsToTheSpecifiedResource ()
881886 {
882887 $ this ->connection ->expects ($ this ->once ())
@@ -891,7 +896,7 @@ public function testUpdatingWebhookPutsToTheSpecifiedResource()
891896 ->with ($ this ->basePath . '/hooks/1 ' , (object )array ());
892897 Client::updateWebhook (1 , array ());
893898 }
894-
899+
895900 public function testDeleteWebhookDeletesToTheSpecifiedResource ()
896901 {
897902 $ this ->connection ->expects ($ this ->once ())
0 commit comments