[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/tests/ -> statslib_test.php (summary)

Tests for ../statslib.php

Copyright: 2012 Tyler Bannister
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 719 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 lib/tests/fixtures/stats_events.php

Defines 1 class

core_statslib_testcase:: (18 methods):
  setUp()
  prepare_db()
  generate_replacement_list()
  load_xml_data_file()
  daily_log_provider()
  verify_stats()
  test_statslib_progress_debug()
  test_statslib_progress_no_debug()
  test_statslib_get_start_from()
  test_statslib_get_base_daily()
  test_statslib_get_next_day_start()
  test_statslib_get_action_names()
  test_statslib_temp_table_create_and_drop()
  test_statslib_temp_table_fill()
  test_statslib_temp_table_setup()
  test_statslib_temp_table_clean()
  test_statslib_cron_daily()
  test_statslib_cron_daily_no_default_profile_id()


Class: core_statslib_testcase  - X-Ref

Test functions that affect daily stats.

setUp()   X-Ref
Setup function
- Allow changes to CFG->debug for testing purposes.


prepare_db($dataset, $tables)   X-Ref
Function to setup database.

param: array $dataset An array of tables including the log table.
param: array $tables

generate_replacement_list()   X-Ref
Load dataset from XML file.


load_xml_data_file($file)   X-Ref
Load dataset from XML file.

param: string $file The name of the file to load
return: array

daily_log_provider()   X-Ref
Provides the log data for test_statslib_cron_daily.

return: array of fixture XML log file names.

verify_stats($expected, $output = '')   X-Ref
Compare the expected stats to those in the database.

param: array $expected
param: string $output

test_statslib_progress_debug()   X-Ref
Test progress output when debug is on.


test_statslib_progress_no_debug()   X-Ref
Test progress output when debug is off.


test_statslib_get_start_from()   X-Ref
Test the function that gets the start date from the config.


test_statslib_get_base_daily()   X-Ref
Test the function that calculates the start of the day.

NOTE: I don't think this is the way this function should work.
This test documents the current functionality.

test_statslib_get_next_day_start()   X-Ref
Test the function that gets the start of the next day.


test_statslib_get_action_names()   X-Ref
Test the function that gets the action names.

Note: The function results depend on installed modules.  The hard coded lists are the
defaults for a new Moodle 2.3 install.

test_statslib_temp_table_create_and_drop()   X-Ref
Test the temporary table creation and deletion.


test_statslib_temp_table_fill()   X-Ref
Test the temporary table creation and deletion.


test_statslib_temp_table_setup()   X-Ref
Test the temporary table creation and deletion.


test_statslib_temp_table_clean()   X-Ref
Test the function that clean out the temporary tables.


test_statslib_cron_daily($xmlfile)   X-Ref
Test the daily stats function.


test_statslib_cron_daily_no_default_profile_id()   X-Ref
Test the daily stats function.




Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1