Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeawhanlee committed Jul 29, 2024
1 parent c202e08 commit 14a0420
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 47 deletions.
13 changes: 0 additions & 13 deletions tests/Integration/inc/Engine/CDN/Subscriber/rewriteSrcset.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@
* @group CDN
*/
class Test_RewriteSrcset extends TestCase {
public function set_up() {
parent::set_up();

// Disable ATF optimization to prevent DB request (unrelated to the test).
add_filter( 'rocket_above_the_fold_optimization', '__return_false' );
}

public function tear_down() {
remove_filter( 'rocket_above_the_fold_optimization', '__return_false' );

parent::tear_down();
}

/**
* @dataProvider configTestData
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ class Test_AddPurgeTermLink extends AdminTestCase {
private $tag;

public function tear_down() {
// Disable ATF optimization to prevent DB request (unrelated to the test).
add_filter( 'rocket_above_the_fold_optimization', '__return_false' );
wp_delete_term( $this->tag->term_id, 'post_tag' );
// Re-enable ATF optimization.
remove_filter( 'rocket_above_the_fold_optimization', '__return_false' );

parent::tear_down();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,12 @@ public function set_up() {

// Install the preload cache table to prevent DB error caused by permalink changed.
self::installPreloadCacheTable();

// Disable ATF optimization to prevent DB request (unrelated to the test).
add_filter( 'rocket_above_the_fold_optimization', '__return_false' );
}

public function tear_down() {
// Uninstall the preload cache table.
self::uninstallPreloadCacheTable();

// Re-enable ATF optimization.
remove_filter( 'rocket_above_the_fold_optimization', '__return_false' );

parent::tear_down();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,9 @@ public function set_up() {
'publicly_queryable' => false,
]
);

// Disable ATF optimization to prevent DB request (unrelated to the test).
add_filter( 'rocket_above_the_fold_optimization', '__return_false' );
}

public function tear_down() {
// Re-enable ATF optimization.
remove_filter( 'rocket_above_the_fold_optimization', '__return_false' );

unregister_taxonomy( 'not_public' );
unset( $GLOBALS['sitepress'], $GLOBALS['q_config'], $GLOBALS['polylang'] );
unset( $GLOBALS['debug_fs'] );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,13 @@ public function set_up() {
// Install the preload cache table to prevent DB error caused by permalink changed.
self::installPreloadCacheTable();

// Disable ATF optimization to prevent DB request (unrelated to the test).
add_filter( 'rocket_above_the_fold_optimization', '__return_false' );

$this->set_permalink_structure( '/%postname%/' );
}

public function tear_down() {
// Uninstall the preload cache table.
self::uninstallPreloadCacheTable();

// Re-enable ATF optimization.
remove_filter( 'rocket_above_the_fold_optimization', '__return_false' );

parent::tear_down();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ public function set_up() {
// Install the preload cache table to prevent DB error caused by permalink changed.
self::installPreloadCacheTable();

// Disable ATF optimization to prevent DB request (unrelated to the test).
add_filter( 'rocket_above_the_fold_optimization', '__return_false' );

wp_set_current_user( self::$user_id );
$this->set_permalink_structure( "/%postname%/" );
set_current_screen( 'edit.php' );
Expand All @@ -44,9 +41,6 @@ public function tear_down() {
// Uninstall the preload cache table.
self::uninstallPreloadCacheTable();

// Re-enable ATF optimization.
remove_filter( 'rocket_above_the_fold_optimization', '__return_false' );

set_current_screen( 'front' );

parent::tear_down();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public function set_up() {
// Install the preload cache table to prevent DB error caused by permalink changed.
self::installPreloadCacheTable();

// Disable ATF optimization to prevent DB request (unrelated to the test).
add_filter( 'rocket_above_the_fold_optimization', '__return_false' );

wp_set_current_user( self::$user_id );
$this->set_permalink_structure( "/%postname%/" );
}
Expand All @@ -42,9 +39,6 @@ public function tear_down() {
// Uninstall the preload cache table.
self::uninstallPreloadCacheTable();

// Re-enable ATF optimization.
remove_filter( 'rocket_above_the_fold_optimization', '__return_false' );

parent::tear_down();
}

Expand Down

0 comments on commit 14a0420

Please sign in to comment.