Skip to content

Commit 93f80cc

Browse files
committed
Added testGetAccessTokenByAPIKeyAndSecretWithBlankClientID test
1 parent 0efd927 commit 93f80cc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/wpunit/APITest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,22 @@ public function testGetAccessTokenByAPIKeyAndSecretWithInvalidClientID()
620620
$this->assertEquals($result->get_error_code(), $this->errorCode);
621621
}
622622

623+
/**
624+
* Test that fetching an Access Token using a blank client ID returns a WP_Error.
625+
*
626+
* @since 2.0.7
627+
*/
628+
public function testGetAccessTokenByAPIKeyAndSecretWithBlankClientID()
629+
{
630+
$api = new ConvertKit_API_V4( '', $_ENV['CONVERTKIT_OAUTH_REDIRECT_URI'] );
631+
$result = $api->get_access_token_by_api_key_and_secret(
632+
$_ENV['CONVERTKIT_API_KEY'],
633+
$_ENV['CONVERTKIT_API_SECRET']
634+
);
635+
$this->assertInstanceOf(WP_Error::class, $result);
636+
$this->assertEquals($result->get_error_code(), $this->errorCode);
637+
}
638+
623639
/**
624640
* Test that supplying valid API credentials to the API class returns the expected account information.
625641
*

0 commit comments

Comments
 (0)