Tests: Use assertSame() in some newly introduced tests.

This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [55859], [56380], [56802], [57115], [57129], [57185].

See #59655.

git-svn-id: https://develop.svn.wordpress.org/trunk@57244 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2024-01-06 12:59:49 +00:00
parent 15637fa436
commit b9ca649f3b
5 changed files with 13 additions and 13 deletions
+4 -4
View File
@@ -1259,8 +1259,8 @@ class Tests_Theme extends WP_UnitTestCase {
// Cleanup.
switch_theme( $old_theme->get_stylesheet() );
$this->assertEquals( $old_root . '/test', $path1, 'The original stylesheet path is not correct' );
$this->assertEquals( $new_root . '/test', $path2, 'The new stylesheet path is not correct' );
$this->assertSame( $old_root . '/test', $path1, 'The original stylesheet path is not correct' );
$this->assertSame( $new_root . '/test', $path2, 'The new stylesheet path is not correct' );
}
/**
@@ -1302,7 +1302,7 @@ class Tests_Theme extends WP_UnitTestCase {
// Cleanup.
switch_theme( $old_theme->get_stylesheet() );
$this->assertEquals( $old_root . '/test-parent', $path1, 'The original template path is not correct' );
$this->assertEquals( $new_root . '/test-parent', $path2, 'The new template path is not correct' );
$this->assertSame( $old_root . '/test-parent', $path1, 'The original template path is not correct' );
$this->assertSame( $new_root . '/test-parent', $path2, 'The new template path is not correct' );
}
}