Changeset 62557 for trunk/tests/phpunit/tests/ai-client/wpAiClientCache.php
- Timestamp:
- 06/25/2026 09:08:14 AM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ai-client/wpAiClientCache.php
r61700 r62557 219 219 $this->assertSame( 'value1', $this->cache->get( 'key1' ) ); 220 220 } 221 222 /** 223 * Test that the cache group filter is respected. 224 * 225 * @ticket 65127 226 */ 227 public function test_cache_group_filter_is_respected() { 228 add_filter( 229 'wp_ai_client_cache_group', 230 function ( $group ) { 231 return 'wp_ai_client_tests_group'; 232 } 233 ); 234 235 $set = $this->cache->set( 'ai_test_key', 'ai_value', 3600 ); 236 $this->assertTrue( $set ); 237 238 $value = wp_cache_get( 'ai_test_key', 'wp_ai_client_tests_group' ); 239 $this->assertSame( 'ai_value', $value ); 240 } 241 242 /** 243 * Test that a non-string cache group filter value is cast to string. 244 * 245 * @ticket 65127 246 */ 247 public function test_cache_group_filter_returns_non_string() { 248 add_filter( 249 'wp_ai_client_cache_group', 250 function ( $group ) { 251 return 12345; 252 } 253 ); 254 255 $set = $this->cache->set( 'ai_test_key', 'ai_value', 3600 ); 256 $this->assertTrue( $set ); 257 258 $value = wp_cache_get( 'ai_test_key', '12345' ); 259 $this->assertSame( 'ai_value', $value ); 260 } 221 261 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)