This commit is contained in:
alorig
2025-11-22 19:46:34 +05:00
parent cbb6198214
commit 8296685fbd
34 changed files with 12200 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
<?php
/**
* Unit test for API key revoke handler
*
* @package Igny8Bridge
*/
class Test_Revoke_Api_Key extends WP_UnitTestCase {
public function test_revoke_api_key_clears_options() {
// Simulate stored API key and tokens
update_option('igny8_api_key', 'test-key-123');
update_option('igny8_access_token', 'test-key-123');
update_option('igny8_refresh_token', 'refresh-123');
update_option('igny8_token_refreshed_at', time());
// Call revoke
Igny8Admin::revoke_api_key();
// Assert removed
$this->assertFalse(get_option('igny8_api_key'));
$this->assertFalse(get_option('igny8_access_token'));
$this->assertFalse(get_option('igny8_refresh_token'));
$this->assertFalse(get_option('igny8_token_refreshed_at'));
}
}