mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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:
@@ -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' );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user