. /** * Unit test for the filter_algebra * * @package filter_algebra * @category phpunit * @copyright 2012 Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); global $CFG; require_once($CFG->dirroot . '/filter/algebra/filter.php'); /** * Unit tests for filter_algebra. * * Note that this only tests some of the filter logic. It does not acutally test * the normal case of the filter working, because I cannot make it work on my * test server, and if it does not work here, it probably does not also work * for other people. A failing test will be irritating noise. * * @copyright 2012 Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class filter_algebra_testcase extends basic_testcase { protected $filter; protected function setUp() { parent::setUp(); $this->filter = new filter_algebra(context_system::instance(), array()); } function test_algebra_filter_no_algebra() { $this->assertEquals('
Look no algebra!
', $this->filter->filter('Look no algebra!
')); } function test_algebra_filter_pluginfile() { $this->assertEquals('' . $diff . '', $this->filter->filter('
' . $diff . '')); } }