Merge branch 'w03_MDL-36411_m25_setup' of git://github.com/skodak/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2013-01-21 20:08:12 +01:00
commit fa669c49ad

View file

@ -35,6 +35,15 @@ defined('MOODLE_INTERNAL') || die();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
class core_phpunit_basic_testcase extends basic_testcase { class core_phpunit_basic_testcase extends basic_testcase {
protected $testassertexecuted = false;
public function setUp() {
if ($this->getName() === 'test_setup_assert') {
$this->assertTrue(true);
$this->testassertexecuted = true;
return;
}
}
/** /**
* Tests that bootstrapping has occurred correctly * Tests that bootstrapping has occurred correctly
@ -113,6 +122,14 @@ class core_phpunit_basic_testcase extends basic_testcase {
$this->assertNotEmpty(new stdClass()); $this->assertNotEmpty(new stdClass());
} }
/**
* Make sure asserts in setUp() do not create problems.
*/
public function test_setup_assert() {
$this->assertTrue($this->testassertexecuted);
$this->testassertexecuted = false;
}
// Uncomment following tests to see logging of unexpected changes in global state and database // Uncomment following tests to see logging of unexpected changes in global state and database
/* /*
public function test_db_modification() { public function test_db_modification() {