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:
@@ -26,6 +26,12 @@ abstract class BaseTestCase extends TestCase {
|
|||||||
// Common WordPress function stubs used across many classes.
|
// Common WordPress function stubs used across many classes.
|
||||||
Functions\stubTranslationFunctions();
|
Functions\stubTranslationFunctions();
|
||||||
Functions\stubEscapeFunctions();
|
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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user