fix: add transient stubs to BaseTestCase setUp to fix remaining 4 test errors

The get_transient, set_transient, and delete_transient functions are now
stubbed in BaseTestCase::setUp() so all tests have them available by default.
Individual tests can still override with Functions\when() in their own setUp.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
peptiderepo
2026-04-12 08:25:00 +07:00
parent 7728db5671
commit f8b4051437

View File

@@ -26,6 +26,12 @@ abstract class BaseTestCase extends TestCase {
// Common WordPress function stubs used across many classes.
Functions\stubTranslationFunctions();
Functions\stubEscapeFunctions();
// Stub transient functions — many classes use caching via transients.
// Individual tests can override with Functions\when() in their own setUp.
Functions\when( 'get_transient' )->justReturn( false );
Functions\when( 'set_transient' )->justReturn( true );
Functions\when( 'delete_transient' )->justReturn( true );
}
/**