@@ -367,24 +367,26 @@ test("Cloudflare canonical lifecycle diagnostics compose the disabled-cron patch
367367 assert . match ( lifecycle , / : " \$ s t o p / )
368368} )
369369
370- test ( "Cloudflare canonical runtime patches the unique init call with the disabled-cron scheduling policy " , async ( ) => {
370+ test ( "Cloudflare canonical runtime patches the unique init call with runtime persistence policies " , async ( ) => {
371371 const worker = await readFile ( new URL ( "../packages/runtime-cloudflare/src/worker.ts" , import . meta. url ) , "utf8" )
372- const patcher = worker . slice ( worker . indexOf ( "function patchCanonicalDisabledCronSchedulingPolicyAtInit " ) , worker . indexOf ( "\nfunction collectRuntimeFiles" ) )
372+ const patcher = worker . slice ( worker . indexOf ( "function patchCanonicalRuntimePoliciesAtInit " ) , worker . indexOf ( "\nfunction collectRuntimeFiles" ) )
373373
374- assert . ok ( patcher . startsWith ( "function patchCanonicalDisabledCronSchedulingPolicyAtInit " ) , "The canonical disabled-cron scheduling policy patcher is present." )
374+ assert . ok ( patcher . startsWith ( "function patchCanonicalRuntimePoliciesAtInit " ) , "The canonical runtime policy patcher is present." )
375375 assert . match ( patcher , / c o n s t s e t t i n g s P a t h = " \/ w o r d p r e s s \/ w p - s e t t i n g s \. p h p " / )
376376 assert . match ( patcher , / p h p \. r e a d F i l e A s B u f f e r \( s e t t i n g s P a t h \) / )
377377 assert . match ( patcher , / f i r s t N e e d l e = = = - 1 \| \| f i r s t N e e d l e ! = = s e t t i n g s \. l a s t I n d e x O f \( n e e d l e \) / )
378- assert . match ( patcher , / t h r o w n e w E r r o r \( " W o r d P r e s s c a n o n i c a l d i s a b l e d - c r o n s c h e d u l i n g p o l i c y p a t c h n e e d l e w a s n o t u n i q u e l y f o u n d \. " \) / )
378+ assert . match ( patcher , / t h r o w n e w E r r o r \( " W o r d P r e s s c a n o n i c a l r u n t i m e p o l i c y p a t c h n e e d l e w a s n o t u n i q u e l y f o u n d \. " \) / )
379379 assert . match ( patcher , / d e f i n e d \( ' D I S A B L E _ W P _ C R O N ' \) & & D I S A B L E _ W P _ C R O N / )
380380 assert . match ( patcher , / r e m o v e _ a c t i o n \( ' i n i t ' , ' w p _ c r o n ' \) / )
381381 assert . match ( patcher , / r e m o v e _ a c t i o n \( ' i n i t ' , ' w p _ s c h e d u l e _ d e l e t e _ o l d _ p r i v a c y _ e x p o r t _ f i l e s ' \) / )
382382 assert . match ( patcher , / r e m o v e _ a c t i o n \( ' i n i t ' , ' w p _ s c h e d u l e _ u p d a t e _ c h e c k s ' \) / )
383+ assert . match ( patcher , / a d d _ f i l t e r \( ' p r e _ u p d a t e _ o p t i o n _ r e w r i t e _ r u l e s ' / )
384+ assert . match ( patcher , / r e t u r n \$ o l d _ v a l u e / )
383385 assert . equal ( ( patcher . match ( / d o _ a c t i o n \( ' i n i t ' \) ; / g) ?? [ ] ) . length , 1 )
384386 assert . match ( patcher , / p h p \. w r i t e F i l e \( s e t t i n g s P a t h / )
385387 assert . doesNotMatch ( patcher , / m u - p l u g i n s | a d d _ a c t i o n \( | W P _ S i t e _ H e a l t h | w p _ s c h e d u l e _ s i t e _ h e a l t h _ c r o n | \$ G L O B A L S \[ ' w p _ f i l t e r ' \] / )
386388 assert . doesNotMatch ( worker , / m a t e r i a l i z e C a n o n i c a l C r o n A d a p t e r | w p - c o d e b o x - c a n o n i c a l - c r o n - p o l i c y / )
387- assert . match ( worker , / r u n t i m e B u c k e t \? : R 2 B u c k e t , \n s h o u l d P a t c h C a n o n i c a l D i s a b l e d C r o n S c h e d u l i n g P o l i c y A t I n i t = f a l s e , / )
389+ assert . match ( worker , / r u n t i m e B u c k e t \? : R 2 B u c k e t , \n s h o u l d P a t c h C a n o n i c a l R u n t i m e P o l i c i e s A t I n i t = f a l s e , / )
388390 assert . match ( worker , / a u t h C o n s t a n t s , b u c k e t , t r u e \) , p o i n t e r / )
389391 assert . match ( worker , / e n v \. W O R D P R E S S _ S T A T E _ B U C K E T , t r u e \) / )
390392 assert . match ( worker , / c a n o n i c a l - p r o b e \. i n v a l i d " , \{ \} , b u c k e t , t r u e \) / )
0 commit comments