Skip to content

Commit ea0350c

Browse files
committed
Skip this on < 6.2 too.
1 parent d5f34be commit ea0350c

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

tests/acceptance/SwitchFromEnglishCest.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace UserSwitching\Tests;
44

5+
use Codeception\Scenario;
6+
57
/**
68
* Acceptance tests for switching from a user who uses English to a user who doesn't
79
*/
@@ -19,7 +21,17 @@ public function _before( \AcceptanceTester $I ): void {
1921
] );
2022
}
2123

22-
public function SwitchFromEnglishAdminToItalianAuthorAndBack( \AcceptanceTester $I ): void {
24+
public function SwitchFromEnglishAdminToItalianAuthorAndBack( \AcceptanceTester $I, Scenario $scenario ): void {
25+
require dirname( __DIR__, 2 ) . '/vendor/wordpress/wordpress/wp-includes/version.php';
26+
27+
/** @var string $wp_version */
28+
29+
$I->comment( sprintf( 'Running test on WordPress version %s', $wp_version ) );
30+
31+
if ( version_compare( $wp_version, '6.2', '<' ) ) {
32+
$scenario->skip( 'This test requires WordPress 6.2 or later.' );
33+
}
34+
2335
$I->loginAsAdmin();
2436
$I->switchToUser( 'autore' );
2537
$I->canSeeThePageInLanguage( 'it-IT' );

tests/acceptance/SwitchToEnglishCest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function _before( \AcceptanceTester $I ): void {
2525
}
2626

2727
public function SwitchFromItalianAdminToEnglishAuthorAndBack( \AcceptanceTester $I, Scenario $scenario ): void {
28-
require_once dirname( __DIR__, 2 ) . '/vendor/wordpress/wordpress/wp-includes/version.php';
28+
require dirname( __DIR__, 2 ) . '/vendor/wordpress/wordpress/wp-includes/version.php';
2929

3030
/** @var string $wp_version */
3131

0 commit comments

Comments
 (0)