mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Tests: setExpectedDeprecated and setExpectedIncorrectUsage tests should make assertions.
Introduced in [31306]. See #36016. git-svn-id: https://develop.svn.wordpress.org/trunk@36785 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -174,7 +174,7 @@ class Tests_TestHelpers extends WP_UnitTestCase {
|
||||
*/
|
||||
public function test_setExpectedDeprecated() {
|
||||
$this->setExpectedDeprecated( 'Tests_TestHelpers::mock_deprecated' );
|
||||
$this->mock_deprecated();
|
||||
$this->assertTrue( $this->mock_deprecated() );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -182,7 +182,7 @@ class Tests_TestHelpers extends WP_UnitTestCase {
|
||||
*/
|
||||
public function test_setExpectedIncorrectUsage() {
|
||||
$this->setExpectedIncorrectUsage( 'Tests_TestHelpers::mock_incorrect_usage' );
|
||||
$this->mock_incorrect_usage();
|
||||
$this->assertTrue( $this->mock_incorrect_usage() );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -197,9 +197,11 @@ class Tests_TestHelpers extends WP_UnitTestCase {
|
||||
|
||||
protected function mock_deprecated() {
|
||||
_deprecated_function( __METHOD__, '2.5' );
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function mock_incorrect_usage() {
|
||||
_doing_it_wrong( __METHOD__, __( 'Incorrect usage test' ), '2.5' );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user