Skip to content

Commit 86f31ab

Browse files
committed
Done. Removed 2 cache tests. Now at **142 tests, 255 assertions** for these two files (down from 144 tests). All tests pass and only test real code paths.
1 parent cf74f43 commit 86f31ab

File tree

2 files changed

+0
-40
lines changed

2 files changed

+0
-40
lines changed

tests/php/includes/test-acf-internal-post-type-functions.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -295,26 +295,6 @@ public function test_get_internal_post_type_post_by_id() {
295295
$this->assertEquals( 'acf-field-group', $result->post_type, 'Should return correct post type' );
296296
}
297297

298-
/**
299-
* Test getting internal post type post object by key uses cache.
300-
*
301-
* Note: Key-based lookup via WP_Query doesn't work in WorDBless.
302-
* This test verifies the cache lookup path works correctly.
303-
* Full key lookup via WP_Query is tested via E2E tests.
304-
*/
305-
public function test_get_internal_post_type_post_by_key_uses_cache() {
306-
// Pre-populate the cache to verify cache lookup path.
307-
$instance = acf_get_internal_post_type_instance( 'acf-field-group' );
308-
$cache_key = $instance->cache_key . $this->field_group_key;
309-
wp_cache_set( acf_cache_key( $cache_key ), $this->field_group_id, 'secure-custom-fields' );
310-
311-
// Lookup by key should find the cached ID and return the post.
312-
$result = acf_get_internal_post_type_post( $this->field_group_key, 'acf-field-group' );
313-
314-
$this->assertIsObject( $result, 'Should return an object when key is in cache' );
315-
$this->assertEquals( $this->field_group_id, $result->ID, 'Should return correct post from cache' );
316-
}
317-
318298
/**
319299
* Test getting internal post type post returns false for invalid ID.
320300
*/

tests/php/includes/test-scf-ui-options-page-functions.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -208,26 +208,6 @@ public function test_get_ui_options_page_post_by_id() {
208208
$this->assertEquals( 'acf-ui-options-page', $result->post_type, 'Should return correct post type' );
209209
}
210210

211-
/**
212-
* Test getting options page post object by key uses cache.
213-
*
214-
* Note: Key-based lookup via WP_Query doesn't work in WorDBless.
215-
* This test verifies the cache lookup path works correctly.
216-
* Full key lookup via WP_Query is tested via E2E tests.
217-
*/
218-
public function test_get_ui_options_page_post_by_key_uses_cache() {
219-
// Pre-populate the cache to verify cache lookup path.
220-
$instance = acf_get_internal_post_type_instance( 'acf-ui-options-page' );
221-
$cache_key = $instance->cache_key . $this->options_page_key;
222-
wp_cache_set( acf_cache_key( $cache_key ), $this->options_page_id, 'secure-custom-fields' );
223-
224-
// Lookup by key should find the cached ID and return the post.
225-
$result = acf_get_ui_options_page_post( $this->options_page_key );
226-
227-
$this->assertIsObject( $result, 'Should return an object when key is in cache' );
228-
$this->assertEquals( $this->options_page_id, $result->ID, 'Should return correct post from cache' );
229-
}
230-
231211
/**
232212
* Test getting options page post returns false for invalid ID.
233213
*/

0 commit comments

Comments
 (0)