wp plugin udapted v1.5.0
This commit is contained in:
@@ -8,20 +8,18 @@
|
||||
class Test_Revoke_Api_Key extends WP_UnitTestCase {
|
||||
|
||||
public function test_revoke_api_key_clears_options() {
|
||||
// Simulate stored API key and tokens
|
||||
// Simulate stored connection data (simplified structure)
|
||||
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());
|
||||
update_option('igny8_site_id', '12345');
|
||||
update_option('igny8_last_communication', time());
|
||||
|
||||
// Call revoke
|
||||
Igny8Admin::revoke_api_key();
|
||||
|
||||
// Assert removed
|
||||
// Assert core connection options 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'));
|
||||
$this->assertFalse(get_option('igny8_site_id'));
|
||||
$this->assertFalse(get_option('igny8_last_communication'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ class Test_Site_Metadata_Endpoint extends WP_UnitTestCase {
|
||||
update_option('igny8_connection_enabled', 1);
|
||||
|
||||
// Create a fake API key so permission checks pass via Igny8API
|
||||
// Note: Only igny8_api_key is needed (access_token was deprecated)
|
||||
update_option('igny8_api_key', 'test-api-key-123');
|
||||
update_option('igny8_access_token', 'test-api-key-123');
|
||||
|
||||
// Build request
|
||||
$request = new WP_REST_Request('GET', '/igny8/v1/site-metadata/');
|
||||
|
||||
Reference in New Issue
Block a user