Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update unit tests for upcoming dependency version policy #1004

Merged
merged 3 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions .github/workflows/pr-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,13 @@ jobs:
fail-fast: false
matrix:
# We test against the earliest and latest PHP versions for each major supported version.
php: [ '5.6', '7.0', '7.4', '8.0' ]
wp: [ '5.2', '5.3', '5.4', '5.5', '5.6', 'latest' ]
php: [ '5.6', '7.0', '7.4', '8.0', '8.1', '8.2' ]
wp: [ '6.1', '6.2', '6.3', 'latest' ]
multisite: [ '0', '1' ]
exclude:
# Earlier versions of WordPress do not support PHP 7.4+
- php: 7.4
wp: 5.2
- php: 8.0
wp: 5.2
- php: 8.0
wp: 5.3
- php: 8.0
wp: 5.4
- php: 8.0
wp: 5.5
# WordPress 6.3+ requires PHP 7.0+
- php: 5.6
wp: 6.3
- php: 5.6
wp: latest
services:
Expand Down
6 changes: 3 additions & 3 deletions tests/phpunit/procedural_api/procedural_api_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public function test_unschedule_all( $time, $hook, $args, $group ) {

public function test_as_get_datetime_object_default() {

$utc_now = new ActionScheduler_DateTime( null, new DateTimeZone( 'UTC' ) );
$utc_now = new ActionScheduler_DateTime( 'now', new DateTimeZone( 'UTC' ) );
$as_now = as_get_datetime_object();

// Don't want to use 'U' as timestamps will always be in UTC.
Expand Down Expand Up @@ -268,7 +268,7 @@ public function test_as_get_datetime_object_timezone() {
// phpcs:ignore
date_default_timezone_set( $timezone_au );

$au_now = new ActionScheduler_DateTime( null );
$au_now = new ActionScheduler_DateTime( 'now' );
$as_now = as_get_datetime_object();

// Make sure they're for the same time.
Expand All @@ -277,7 +277,7 @@ public function test_as_get_datetime_object_timezone() {
// But not in the same timezone, as $as_now should be using UTC.
$this->assertNotEquals( $au_now->format( 'Y-m-d H:i:s' ), $as_now->format( 'Y-m-d H:i:s' ) );

$au_now = new ActionScheduler_DateTime( null );
$au_now = new ActionScheduler_DateTime( 'now' );
$as_au_now = as_get_datetime_object();

$this->assertEquals( $au_now->getTimestamp(), $as_now->getTimestamp(), '', 2 );
Expand Down
Loading