MDL-35479 document unit test debugging() changes

This commit is contained in:
Petr Škoda 2012-09-17 12:09:25 +02:00
parent a3b6e311b8
commit 94c9db5493
3 changed files with 17 additions and 6 deletions

View File

@ -241,7 +241,7 @@ abstract class advanced_testcase extends PHPUnit_Framework_TestCase {
/**
* Return debugging messages from the current test.
* @return array
* @return array with instances having 'message', 'level' and 'stacktrace' property.
*/
public function getDebuggingMessages() {
return phpunit_util::get_debugging_messages();
@ -249,10 +249,9 @@ abstract class advanced_testcase extends PHPUnit_Framework_TestCase {
/**
* Clear all previous debugging messages in current test.
* @return array
*/
public function resetDebugging() {
return phpunit_util::reset_debugging();
phpunit_util::reset_debugging();
}
/**
@ -293,6 +292,10 @@ abstract class advanced_testcase extends PHPUnit_Framework_TestCase {
phpunit_util::reset_debugging();
}
/**
* Call when no debugging() messages expected.
* @param string $message
*/
public function assertDebuggingNotCalled($message = '') {
$debugging = phpunit_util::get_debugging_messages();
$count = count($debugging);

View File

@ -136,7 +136,7 @@ abstract class database_driver_testcase extends PHPUnit_Framework_TestCase {
/**
* Return debugging messages from the current test.
* @return array
* @return array with instances having 'message', 'level' and 'stacktrace' property.
*/
public function getDebuggingMessages() {
return phpunit_util::get_debugging_messages();
@ -144,10 +144,9 @@ abstract class database_driver_testcase extends PHPUnit_Framework_TestCase {
/**
* Clear all previous debugging messages in current test.
* @return array
*/
public function resetDebugging() {
return phpunit_util::reset_debugging();
phpunit_util::reset_debugging();
}
/**
@ -188,6 +187,10 @@ abstract class database_driver_testcase extends PHPUnit_Framework_TestCase {
phpunit_util::reset_debugging();
}
/**
* Call when no debugging() messages expected.
* @param string $message
*/
public function assertDebuggingNotCalled($message = '') {
$debugging = phpunit_util::get_debugging_messages();
$count = count($debugging);

View File

@ -11,6 +11,11 @@ YUI changes:
* moodle-enrol-notification has been renamed to moodle-core-notification
* YUI2 code must now use 2in3, see http://yuilibrary.com/yui/docs/yui/yui-yui2.html
Unit testing changes:
* output debugging() is not sent to standard output any more,
use $this->assertDebuggingCalled(), $this->assertDebuggingNotCalled(),
$this->getDebuggingMessages() or $this->assertResetDebugging() instead.
=== 2.3 ===
Database layer changes: