diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 373be62..ded4e07 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,8 +44,9 @@ jobs: # Defines the WordPress and PHP Versions matrix to run tests on. strategy: + fail-fast: false matrix: - wp-versions: [ '6.6-RC3' ] #[ 'latest', '6.1.1' ] + wp-versions: [ 'latest' ] #[ 'latest', '6.1.1' ] php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3' ] #[ '7.4', '8.0', '8.1', '8.2' ] # Steps to install, configure and run tests diff --git a/tests/wpunit/APITest.php b/tests/wpunit/APITest.php index f14af87..dcc85ca 100644 --- a/tests/wpunit/APITest.php +++ b/tests/wpunit/APITest.php @@ -491,6 +491,20 @@ public function testRefreshTokenWithInvalidToken() $this->assertEquals($result->get_error_code(), 'convertkit_api_error'); } + /** + * Test that supplying no API credentials to the API class returns a WP_Error. + * + * @since 2.0.2 + */ + public function testNoAPICredentials() + { + $api = new ConvertKit_API_V4( $_ENV['CONVERTKIT_OAUTH_CLIENT_ID'], $_ENV['CONVERTKIT_OAUTH_REDIRECT_URI'] ); + $result = $api->get_account(); + $this->assertInstanceOf(WP_Error::class, $result); + $this->assertEquals($result->get_error_code(), $this->errorCode); + $this->assertEquals($result->get_error_message(), 'Authentication Failed'); + } + /** * Test that supplying invalid API credentials to the API class returns a WP_Error. * @@ -498,7 +512,7 @@ public function testRefreshTokenWithInvalidToken() */ public function testInvalidAPICredentials() { - $api = new ConvertKit_API_V4( $_ENV['CONVERTKIT_OAUTH_CLIENT_ID'], $_ENV['CONVERTKIT_OAUTH_REDIRECT_URI'] ); + $api = new ConvertKit_API_V4( $_ENV['CONVERTKIT_OAUTH_CLIENT_ID'], $_ENV['CONVERTKIT_OAUTH_REDIRECT_URI'], 'fakeAccessToken', 'fakeRefreshToken' ); $result = $api->get_account(); $this->assertInstanceOf(WP_Error::class, $result); $this->assertEquals($result->get_error_code(), $this->errorCode);