MDL-19579 code coverage - add more initial $includecoverage attributes

This commit is contained in:
stronk7 2009-06-26 17:49:15 +00:00
parent d47cf63dec
commit 081a63a9eb
18 changed files with 33 additions and 1 deletions

View file

@ -13,6 +13,9 @@ if (!defined('MOODLE_INTERNAL')) {
} }
class accesslib_test extends UnitTestCaseUsingDatabase { class accesslib_test extends UnitTestCaseUsingDatabase {
public static $includecoverage = array('lib/accesslib.php');
function test_get_parent_contexts() { function test_get_parent_contexts() {
$context = get_context_instance(CONTEXT_SYSTEM); $context = get_context_instance(CONTEXT_SYSTEM);
$this->assertEqual(get_parent_contexts($context), array()); $this->assertEqual(get_parent_contexts($context), array());

View file

@ -39,6 +39,8 @@ require_once($CFG->dirroot . '/backup/backuplib.php');
class backuplib_test extends UnitTestCase { class backuplib_test extends UnitTestCase {
public static $includecoverage = array('backup/backuplib.php');
} }
?> ?>

View file

@ -39,6 +39,7 @@ require_once($CFG->libdir . '/blocklib.php');
/** Test-specific subclass to make some protected things public. */ /** Test-specific subclass to make some protected things public. */
class testable_block_manager extends block_manager { class testable_block_manager extends block_manager {
public function mark_loaded() { public function mark_loaded() {
$this->birecordsbyregion = array(); $this->birecordsbyregion = array();
} }
@ -58,6 +59,7 @@ class block_ablocktype extends block_base {
* Test functions that don't need to touch the database. * Test functions that don't need to touch the database.
*/ */
class moodle_block_manager_test extends UnitTestCase { class moodle_block_manager_test extends UnitTestCase {
public static $includecoverage = array('lib/pagelib.php', 'lib/blocklib.php');
protected $testpage; protected $testpage;
protected $blockmanager; protected $blockmanager;

View file

@ -88,6 +88,8 @@ class TimeModifiedExpectation extends SimpleExpectation {
} }
class completionlib_test extends FakeDBUnitTestCase { class completionlib_test extends FakeDBUnitTestCase {
public static $includecoverage = array('lib/completionlib.php');
var $realdb,$realcfg,$realsession,$realuser; var $realdb,$realcfg,$realsession,$realuser;
function setUp() { function setUp() {

View file

@ -6,6 +6,7 @@ if (!defined('MOODLE_INTERNAL')) {
require_once($CFG->dirroot . '/lib/conditionlib.php'); require_once($CFG->dirroot . '/lib/conditionlib.php');
class conditionlib_test extends FakeDBUnitTestCase { class conditionlib_test extends FakeDBUnitTestCase {
public static $includecoverage = array('lib/conditionlib.php');
var $oldcfg; var $oldcfg;
public function setUp() { public function setUp() {

View file

@ -43,6 +43,7 @@ class filelib_test extends UnitTestCaseUsingDatabase {
protected $coursecat; protected $coursecat;
protected $user; protected $user;
protected $module; protected $module;
public static $includecoverage = array('lib/filelib.php');
/** /**
* Setup the DB fixture data * Setup the DB fixture data

View file

@ -42,6 +42,7 @@ require_once($CFG->libdir . '/filterlib.php');
*/ */
class filter_active_global_test extends UnitTestCaseUsingDatabase { class filter_active_global_test extends UnitTestCaseUsingDatabase {
private $syscontextid; private $syscontextid;
public static $includecoverage = array('lib/filterlib.php');
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();

View file

@ -38,6 +38,7 @@ if (!defined('MOODLE_INTERNAL')) {
require_once($CFG->libdir . '/filterlib.php'); require_once($CFG->libdir . '/filterlib.php');
class testable_filter_manager extends filter_manager { class testable_filter_manager extends filter_manager {
public function __construct() { public function __construct() {
parent::__construct(); parent::__construct();
} }
@ -53,6 +54,7 @@ class testable_filter_manager extends filter_manager {
* Test functions that affect filter_active table with contextid = $syscontextid. * Test functions that affect filter_active table with contextid = $syscontextid.
*/ */
class filter_manager_test extends UnitTestCase { class filter_manager_test extends UnitTestCase {
public static $includecoverage = array('lib/filterlib.php');
protected $filtermanager; protected $filtermanager;
protected $olddirroot; protected $olddirroot;

View file

@ -14,6 +14,8 @@ require_once($CFG->libdir . '/mathslib.php');
*/ */
class mathsslib_test extends UnitTestCase { class mathsslib_test extends UnitTestCase {
public static $includecoverage = array('lib/mathslib.php');
/** /**
* Tests the basic formula evaluation * Tests the basic formula evaluation
*/ */

View file

@ -96,6 +96,9 @@ class moodle_test_renderer extends moodle_core_renderer {
* @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 renderer_factory_base_test extends UnitTestCase { class renderer_factory_base_test extends UnitTestCase {
public static $includecoverage = array('lib/outputlib.php');
public function test_get_calls_create() { public function test_get_calls_create() {
// Set up. // Set up.
$factory = new testable_renderer_factory(); $factory = new testable_renderer_factory();

View file

@ -56,6 +56,7 @@ class testable_moodle_page extends moodle_page {
class moodle_page_test extends UnitTestCase { class moodle_page_test extends UnitTestCase {
protected $testpage; protected $testpage;
protected $originalcourse; protected $originalcourse;
public static $includecoverage = array('lib/pagelib.php', 'lib/blocklib.php');
public function setUp() { public function setUp() {
global $COURSE; global $COURSE;

View file

@ -39,6 +39,8 @@ require_once($CFG->libdir . '/portfoliolib.php');
class portfoliolibaddbutton_test extends FakeDBUnitTestCase { class portfoliolibaddbutton_test extends FakeDBUnitTestCase {
public static $includecoverage = array('lib/portfoliolib.php');
function test_set_formats() { function test_set_formats() {
$button = new portfolio_add_button(); $button = new portfolio_add_button();

View file

@ -38,6 +38,9 @@ if (!defined('MOODLE_INTERNAL')) {
require_once($CFG->libdir . '/questionlib.php'); require_once($CFG->libdir . '/questionlib.php');
class questionlib_test extends UnitTestCase { class questionlib_test extends UnitTestCase {
public static $includecoverage = array('lib/questionlib.php');
function test_question_sort_qtype_array() { function test_question_sort_qtype_array() {
$config = new stdClass(); $config = new stdClass();
$config->multichoice_sortorder = '1'; $config->multichoice_sortorder = '1';

View file

@ -48,6 +48,8 @@ foreach ($repository_plugins as $plugin) {
class repositorylib_test extends FakeDBUnitTestCase { class repositorylib_test extends FakeDBUnitTestCase {
public static $includecoverage = array('repository/lib.php');
function setup() { function setup() {
parent::setup(); parent::setup();
} }

View file

@ -14,6 +14,7 @@ require_once($CFG->libdir.'/simplepie/moodle_simplepie.php');
class moodlesimplepie_test extends UnitTestCase { class moodlesimplepie_test extends UnitTestCase {
public static $includecoverage = array('lib/simplepie/moodle_simplepie.php');
var $testurl = 'http://download.moodle.org/unittest/rsstest.xml'; var $testurl = 'http://download.moodle.org/unittest/rsstest.xml';
function test_getfeed(){ function test_getfeed(){

View file

@ -61,6 +61,8 @@ class testable_string_manager extends string_manager {
} }
class string_manager_test extends UnitTestCase { class string_manager_test extends UnitTestCase {
public static $includecoverage = array('lib/moodlelib.php');
protected $originallang; protected $originallang;
protected $workspace = 'temp/get_string_fixtures'; // Path inside $CFG->dataroot where we work. protected $workspace = 'temp/get_string_fixtures'; // Path inside $CFG->dataroot where we work.
protected $basedir; protected $basedir;

View file

@ -14,6 +14,8 @@ if (!defined('MOODLE_INTERNAL')) {
class web_test extends UnitTestCase { class web_test extends UnitTestCase {
public static $includecoverage = array('lib/weblib.php');
function setUp() { function setUp() {
} }