Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/EndToEnd/general/uninstall/UninstallCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ public function testPluginDeletionRevokesAndRemovesTokens(EndToEndTester $I)
// Delete the Plugin.
$I->deleteKitPlugin($I);

// Allow the uninstallation routine time to complete.
$I->wait(10);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On occasion the test fails as it doesn't give WordPress enough time to complete uninstall.php. This bump of the wait seems to resolve.


// Confirm the credentials have been removed from the Plugin's settings.
$I->wait(3);
$settings = $I->grabOptionFromDatabase('_wp_convertkit_settings');
$I->assertEmpty($settings['access_token']);
$I->assertEmpty($settings['refresh_token']);
Expand Down
24 changes: 10 additions & 14 deletions uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@
'https://api.kit.com/v4/oauth/revoke',
array(
'headers' => array(
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'Content-Type' => 'application/x-www-form-urlencoded',
),
'body' => wp_json_encode(
array(
'client_id' => 'HXZlOCj-K5r0ufuWCtyoyo3f688VmMAYSsKg1eGvw0Y',
'token' => $settings['access_token'],
)
'body' => array(
'client_id' => 'HXZlOCj-K5r0ufuWCtyoyo3f688VmMAYSsKg1eGvw0Y',
'token' => $settings['access_token'],
'token_type_hint' => 'access_token',
),
'timeout' => 5,
)
Expand All @@ -50,14 +48,12 @@
'https://api.kit.com/v4/oauth/revoke',
array(
'headers' => array(
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'Content-Type' => 'application/x-www-form-urlencoded',
),
'body' => wp_json_encode(
array(
'client_id' => 'HXZlOCj-K5r0ufuWCtyoyo3f688VmMAYSsKg1eGvw0Y',
'token' => $settings['refresh_token'],
)
'body' => array(
'client_id' => 'HXZlOCj-K5r0ufuWCtyoyo3f688VmMAYSsKg1eGvw0Y',
'token' => $settings['refresh_token'],
'token_type_hint' => 'refresh_token',
),
'timeout' => 5,
)
Expand Down