MDL-72496 question tests: fix assertTag if tag not found
* The basic_test::assertTag method will issue a warning as $tag is not found, failing the PHP Unit test that uses this method. * Add tests to check that assertTag is working
This commit is contained in:
@@ -146,6 +146,16 @@ STRING;
|
||||
$this->testassertexecuted = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test assert Tag
|
||||
*/
|
||||
public function test_assert_tag() {
|
||||
// This should succeed.
|
||||
self::assertTag(['id' => 'testid'], "<div><span id='testid'></span></div>");
|
||||
$this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
|
||||
self::assertTag(['id' => 'testid'], "<div><div>");
|
||||
}
|
||||
|
||||
// Uncomment following tests to see logging of unexpected changes in global state and database.
|
||||
/*
|
||||
public function test_db_modification() {
|
||||
|
||||
Reference in New Issue
Block a user