29 lines
826 B
PHP
29 lines
826 B
PHP
<?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'));
|
|
}
|
|
}
|
|
|
|
|