Skip to content

Commit 1bdd941

Browse files
committed
test: fix test case
1 parent bcb8438 commit 1bdd941

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

tests/phpunit-legacy/test-constructor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function public_variable() {
5050
* @group constructor
5151
*/
5252
function constructor() {
53-
$this->assertSame( 10, has_action( 'plugins_loaded', array( $this->multi_device_switcher, 'load_plugin_data' ) ) );
53+
$this->assertSame( 10, has_action( 'init', array( $this->multi_device_switcher, 'load_plugin_data' ) ) );
5454
$this->assertSame( 10, has_filter( 'plugins_loaded', array( $this->multi_device_switcher, 'load_textdomain' ) ) );
5555
$this->assertSame( 10, has_filter( 'plugins_loaded', array( $this->multi_device_switcher, 'init' ) ) );
5656

tests/phpunit-legacy/test-functions.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,22 @@ function load_file() {
340340
// var_dump(get_included_files());
341341
}
342342

343+
/**
344+
* @test
345+
* @group functions
346+
*/
347+
public function load_textdomain() {
348+
global $wp_version;
349+
$loaded = $this->multi_device_switcher->load_textdomain();
350+
if ( version_compare( (string) $wp_version, '6.7', '>=' ) ) {
351+
$this->assertTrue( $loaded );
352+
}
353+
else {
354+
$this->assertFalse( $loaded );
355+
}
356+
}
357+
358+
343359
/**
344360
* @test
345361
* @group functions

0 commit comments

Comments
 (0)