Skip to content

Commit

Permalink
add test for output compatibility status table
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence committed Aug 27, 2024
1 parent 941ff2e commit a09f4e0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/phpunit/test-compatibility-layer.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,25 @@ public function test_daily_pantheon_cron() {
$this->assertIsArray( $applied_fixes );
$this->assertArrayHasKey( 'wp-force-login/wp-force-login.php', $applied_fixes );
}

public function test_output_compatibility_status_table() {
$plugins = get_option( 'active_plugins' );
foreach ( [ 'tuxedo-big-file-uploads/tuxedo_big_file_uploads.php', 'phastpress/phastpress.php' ] as $plugin ) {
$plugins[] = $plugin;
}
update_option( 'active_plugins', $plugins );
wp_cache_delete( 'plugins', 'plugins' );

$manual_fixes = Pantheon\Site_Health\get_compatibility_manual_fixes();
$review_fixes = Pantheon\Site_Health\get_compatibility_review_fixes();

$manual_table = Pantheon\Site_Health\output_compatibility_status_table( $manual_fixes, false );

$this->assertStringContainsString( 'Big-file-uploads', $manual_table );
$this->assertStringContainsString( 'Manual Fix Required', $manual_table );

$review_table = Pantheon\Site_Health\output_compatibility_status_table( $review_fixes, false, true );
$this->assertStringContainsString( 'Phastpress', $review_table );
$this->assertStringContainsString( 'Incompatible', $review_table );
}
}

0 comments on commit a09f4e0

Please sign in to comment.