Skip to content

Commit

Permalink
Merge pull request #1004 from woocommerce/update/unit-tests-wordpress…
Browse files Browse the repository at this point in the history
…-php-versions

Update unit tests for upcoming dependency version policy
  • Loading branch information
coreymckrill authored Oct 23, 2023
2 parents 664feba + dd1a3d0 commit d7aa791
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
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

0 comments on commit d7aa791

Please sign in to comment.