. /** * Base test case class. * * @package core * @category test * @author Tony Levi * @copyright 2015 Blackboard (http://www.blackboard.com) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** * Base class for PHPUnit test cases customised for Moodle * * It is intended for functionality common to both basic and advanced_testcase. * * @package core * @category test * @author Tony Levi * @copyright 2015 Blackboard (http://www.blackboard.com) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ abstract class base_testcase extends PHPUnit_Framework_TestCase { /** * Note: we are overriding this method to remove the deprecated error * @see https://tracker.moodle.org/browse/MDL-47129 * * @param array $matcher * @param string $actual * @param string $message * @param boolean $ishtml * * @deprecated 3.0 */ public static function assertTag($matcher, $actual, $message = '', $ishtml = true) { $dom = PHPUnit_Util_XML::load($actual, $ishtml); $tags = PHPUnit_Util_XML::findNodes($dom, $matcher, $ishtml); $matched = count($tags) > 0 && $tags[0] instanceof DOMNode; self::assertTrue($matched, $message); } /** * Note: we are overriding this method to remove the deprecated error * @see https://tracker.moodle.org/browse/MDL-47129 * * @param array $matcher * @param string $actual * @param string $message * @param boolean $ishtml * * @deprecated 3.0 */ public static function assertNotTag($matcher, $actual, $message = '', $ishtml = true) { $dom = PHPUnit_Util_XML::load($actual, $ishtml); $tags = PHPUnit_Util_XML::findNodes($dom, $matcher, $ishtml); $matched = count($tags) > 0 && $tags[0] instanceof DOMNode; self::assertFalse($matched, $message); } }