Files
igny8/plugins/wordpress/source/igny8-wp-bridge/tests/test-revoke-api-key.php
2026-01-13 08:19:55 +00:00

27 lines
729 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 connection data (simplified structure)
update_option('igny8_api_key', 'test-key-123');
update_option('igny8_site_id', '12345');
update_option('igny8_last_communication', time());
// Call revoke
Igny8Admin::revoke_api_key();
// Assert core connection options removed
$this->assertFalse(get_option('igny8_api_key'));
$this->assertFalse(get_option('igny8_site_id'));
$this->assertFalse(get_option('igny8_last_communication'));
}
}