@@ -411,70 +411,4 @@ public function test_get_bf_notices_date_boundaries() {
411411 $ result = $ this ->admin ->get_bf_notices ( 'free ' );
412412 $ this ->assertNotEmpty ( $ result , 'Should show notices at exact end time ' );
413413 }
414-
415- /**
416- * Test add_black_friday_data yearly plans.
417- */
418- public function test_add_black_friday_data_yearly_plans () {
419- $ base_config = [ 'default ' => [ 'title ' => 'Base ' , 'message ' => 'Message ' ] ];
420- // Mock settings to return a yearly plan
421- update_option ( 'optml_settings ' , [ 'service_data ' => [ 'plan ' => 'starter-yearly ' ] ] );
422- // Reinitialize admin to pick up the new settings
423- $ this ->admin = new Optml_Admin ();
424- $ result = $ this ->admin ->add_black_friday_data ( $ base_config );
425- $ this ->assertEquals ( $ base_config , $ result );
426- $ this ->assertArrayNotHasKey ( 'optimole-wp ' , $ result );
427- }
428-
429- /**
430- * Test add_black_friday_data free plan.
431- */
432- public function test_add_black_friday_data_free_plan () {
433- $ base_config = [ 'default ' => [ 'title ' => 'Base ' , 'message ' => 'Message ' ] ];
434- // Mock settings to return a free plan
435- update_option ( 'optml_settings ' , [ 'service_data ' => [ 'plan ' => 'free ' ] ] );
436- // Reinitialize admin to pick up the new settings
437- $ this ->admin = new Optml_Admin ();
438- $ result = $ this ->admin ->add_black_friday_data ( $ base_config );
439- $ this ->assertArrayHasKey ( 'optimole-wp ' , $ result );
440- $ config = $ result ['optimole-wp ' ];
441- $ this ->assertStringContainsString ( 'Black Friday ' , $ config ['title ' ] );
442- $ this ->assertStringContainsString ( 'BFCM2525 ' , $ config ['message ' ] );
443- $ this ->assertStringContainsString ( '25% OFF ' , $ config ['message ' ] );
444- $ this ->assertStringContainsString ( 'upgrade ' , $ config ['sale_url ' ] );
445- $ this ->assertTrue ( $ config ['dismiss ' ] );
446- }
447-
448- /**
449- * Test add_black_friday_data monthly plan.
450- */
451- public function test_add_black_friday_data_monthly_plan () {
452- $ base_config = [ 'default ' => [ 'title ' => 'Base ' , 'message ' => 'Message ' ] ];
453- // Mock settings to return a monthly plan
454- update_option ( 'optml_settings ' , [ 'service_data ' => [ 'plan ' => 'starter ' ] ] );
455- // Reinitialize admin to pick up the new settings
456- $ this ->admin = new Optml_Admin ();
457- $ result = $ this ->admin ->add_black_friday_data ( $ base_config );
458- $ this ->assertArrayHasKey ( 'optimole-wp ' , $ result );
459- $ config = $ result ['optimole-wp ' ];
460- $ this ->assertStringContainsString ( 'Black Friday ' , $ config ['title ' ] );
461- $ this ->assertStringContainsString ( 'Switch to a yearly plan ' , $ config ['message ' ] );
462- $ this ->assertStringContainsString ( '15% OFF ' , $ config ['message ' ] );
463- $ this ->assertStringContainsString ( 'contact ' , $ config ['sale_url ' ] );
464- $ this ->assertTrue ( $ config ['dismiss ' ] );
465- }
466-
467- /**
468- * Test get_sale_url_for_monthly_plan.
469- */
470- public function test_get_sale_url_for_monthly_plan () {
471- $ reflection = new \ReflectionMethod ( $ this ->admin , 'get_sale_url_for_monthly_plan ' );
472- $ reflection ->setAccessible ( true );
473- $ url = $ reflection ->invoke ( $ this ->admin );
474-
475- $ this ->assertStringContainsString ( 'contact_subject ' , $ url );
476- $ this ->assertStringContainsString ( 'contact_website ' , $ url );
477- $ this ->assertStringContainsString ( 'contact_description ' , $ url );
478- $ this ->assertStringContainsString ( 'Upgrade%20to%20yearly%20plan ' , $ url );
479- }
480414}
0 commit comments