From 6b7df0b5d1561924e635e6b07961413f94e4753a Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sun, 7 Apr 2013 17:47:16 +0200 Subject: [PATCH] MDL-39005 unittest: add the upgradelib test template. --- lib/tests/upgradelib_test.php | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 lib/tests/upgradelib_test.php diff --git a/lib/tests/upgradelib_test.php b/lib/tests/upgradelib_test.php new file mode 100644 index 00000000000..b0c7ce5e4c8 --- /dev/null +++ b/lib/tests/upgradelib_test.php @@ -0,0 +1,45 @@ +. + +/** + * Unit tests for the lib/upgradelib.php library + * + * @package core + * @category phpunit + * @copyright 2013 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +global $CFG; +require_once($CFG->libdir.'/upgradelib.php'); + + +/** + * Tests various classes and functions in upgradelib.php library + */ +class upgradelib_test extends advanced_testcase { + + /** + * Test the {@link upgrade_stale_php_files_present() function + */ + public function test_upgrade_stale_php_files_present() { + // Just call the function, must return bool false always + // if there aren't any old files in the codebase. + $this->assertFalse(upgrade_stale_php_files_present()); + } +} -- 2.43.0