Skip to content

Commit

Permalink
checkstyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
diosmosis committed Oct 22, 2023
1 parent 6335fec commit eee8508
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/phpunit/wpmatomo/test-release.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ public function get_needed_files() {

public function test_latest_release_is_not_too_old() {
$url = 'https://api.wordpress.org/plugins/info/1.0/matomo.json';

// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
$api_response = file_get_contents( $url );
$api_response = json_decode( $api_response, true );

$last_updated = strtotime( $api_response['last_updated'] );
$six_months_ago = (new DateTime('-6 months ago'))->getTimestamp();
$last_updated = strtotime( $api_response['last_updated'] );
$six_months_ago = ( new DateTime( '-6 months ago' ) )->getTimestamp();

$this->assertLessThan($six_months_ago, $last_updated, "The last release of this plugins was over 6 months ago, another release is needed to show the plugin is not abandoned.");
$this->assertLessThan( $six_months_ago, $last_updated, 'The last release of this plugins was over 6 months ago, another release is needed to show the plugin is not abandoned.' );
}
}

0 comments on commit eee8508

Please sign in to comment.