Skip to content

Commit

Permalink
make linting of phpunit compatible with Moodle 4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
semteacher committed Jul 1, 2024
1 parent 1b062be commit f084c63
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 28 deletions.
18 changes: 9 additions & 9 deletions tests/bo_availability/condition_all_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function tearDown(): void {
* @dataProvider booking_common_settings_provider
*
*/
public function test_booking_bookit_with_price_and_cancellation() {
final public function test_booking_bookit_with_price_and_cancellation(): void {
global $DB, $CFG;

// Set parems requred for cancellation.
Expand Down Expand Up @@ -227,7 +227,7 @@ public function test_booking_bookit_with_price_and_cancellation() {
*
* @dataProvider booking_common_settings_provider
*/
public function test_booking_bookit_simple() {
final public function test_booking_bookit_simple(): void {
global $DB, $CFG;

$bdata['cancancelbook'] = 1;
Expand Down Expand Up @@ -376,7 +376,7 @@ public function test_booking_bookit_simple() {
*
* @dataProvider booking_common_settings_provider
*/
public function test_booking_bookit_cohorts_and_bookingtime() {
final public function test_booking_bookit_cohorts_and_bookingtime(): void {
global $DB, $CFG;

$bdata['cancancelbook'] = 1;
Expand Down Expand Up @@ -502,7 +502,7 @@ public function test_booking_bookit_cohorts_and_bookingtime() {
*
* @dataProvider booking_common_settings_provider
*/
public function test_booking_bookit_add_to_group() {
final public function test_booking_bookit_add_to_group(): void {
global $DB, $CFG;

$bdata['cancancelbook'] = 1;
Expand Down Expand Up @@ -600,7 +600,7 @@ public function test_booking_bookit_add_to_group() {
*
* @dataProvider booking_common_settings_provider
*/
public function test_booking_bookit_bookingtime() {
final public function test_booking_bookit_bookingtime(): void {
global $DB, $CFG;

$bdata['cancancelbook'] = 1;
Expand Down Expand Up @@ -679,7 +679,7 @@ public function test_booking_bookit_bookingtime() {
*
* @dataProvider booking_common_settings_provider
*/
public function test_booking_bookit_askforconfirmation() {
final public function test_booking_bookit_askforconfirmation(): void {
global $DB, $CFG;

$bdata['cancancelbook'] = 1;
Expand Down Expand Up @@ -760,7 +760,7 @@ public function test_booking_bookit_askforconfirmation() {
*
* @dataProvider booking_common_settings_provider
*/
public function test_booking_bookit_askforconfirmation_with_price() {
final public function test_booking_bookit_askforconfirmation_with_price(): void {
global $DB, $CFG;

$bdata['cancancelbook'] = 1;
Expand Down Expand Up @@ -970,7 +970,7 @@ public function test_booking_bookit_askforconfirmation_with_price() {
*
* @dataProvider booking_common_settings_provider
*/
public function test_booking_bookwithcredits(array $bdata) {
final public function test_booking_bookwithcredits(array $bdata): void {
global $CFG;

$this->resetAfterTest();
Expand Down Expand Up @@ -1080,7 +1080,7 @@ public function test_booking_bookwithcredits(array $bdata) {
*
* @dataProvider booking_common_settings_provider
*/
public function test_booking_bookit_overbooking_with_price() {
final public function test_booking_bookit_overbooking_with_price(): void {
global $DB, $CFG;

// Setup test data.
Expand Down
8 changes: 4 additions & 4 deletions tests/bo_availability/condition_allowupdate_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function tearDown(): void {
*
* @dataProvider booking_common_settings_provider
*/
public function test_booking_bookit_allowupdate(array $bdata) {
final public function test_booking_bookit_allowupdate(array $bdata): void {
global $DB, $CFG;

$bdata['cancancelbook'] = 1;
Expand Down Expand Up @@ -151,7 +151,7 @@ public function test_booking_bookit_allowupdate(array $bdata) {
*
* @dataProvider booking_common_settings_provider
*/
public function test_booking_bookit_isbookable(array $bdata) {
final public function test_booking_bookit_isbookable(array $bdata): void {
global $DB, $CFG;

// Setup test data.
Expand Down Expand Up @@ -224,7 +224,7 @@ public function test_booking_bookit_isbookable(array $bdata) {
*
* @dataProvider booking_common_settings_provider
*/
public function test_booking_bookit_campaign_blockbooking(array $bdata) {
final public function test_booking_bookit_campaign_blockbooking(array $bdata): void {
global $DB, $CFG;

// Setup test data.
Expand Down Expand Up @@ -337,7 +337,7 @@ public function test_booking_bookit_campaign_blockbooking(array $bdata) {
*
* @dataProvider booking_common_settings_provider
*/
public function test_booking_bookit_subbookings(array $bdata) {
final public function test_booking_bookit_subbookings(array $bdata): void {
global $DB, $CFG;

// Setup test data.
Expand Down
10 changes: 5 additions & 5 deletions tests/bo_availability/condition_bookingpolicy_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function tearDown(): void {
*
* @dataProvider booking_settings_provider
*/
public function test_booking_policy(array $bdata) {
final public function test_booking_policy(array $bdata): void {

// Set test objective setting(s).
$bdata['bookingpolicy'] = 'policy';
Expand Down Expand Up @@ -144,7 +144,7 @@ public function test_booking_policy(array $bdata) {
*
* @dataProvider booking_settings_provider
*/
public function test_booking_customform(array $bdata) {
final public function test_booking_customform(array $bdata): void {

// Setup test data.
$course1 = $this->getDataGenerator()->create_course(['enablecompletion' => 1]);
Expand Down Expand Up @@ -220,7 +220,7 @@ public function test_booking_customform(array $bdata) {
*
* @dataProvider booking_settings_provider
*/
public function test_booking_maxperuser(array $bdata) {
final public function test_booking_maxperuser(array $bdata): void {

// Set test objective setting(s).
$bdata['maxperuser'] = 1;
Expand Down Expand Up @@ -306,7 +306,7 @@ public function test_booking_maxperuser(array $bdata) {
*
* @dataProvider booking_settings_provider
*/
public function test_booking_jsonconditions(array $bdata) {
final public function test_booking_jsonconditions(array $bdata): void {

$this->resetAfterTest();
// Setup test data.
Expand Down Expand Up @@ -452,7 +452,7 @@ public function test_booking_jsonconditions(array $bdata) {
*
* @dataProvider booking_settings_provider
*/
public function test_booking_jsonuserfields(array $bdata) {
final public function test_booking_jsonuserfields(array $bdata): void {
global $CFG;

$this->resetAfterTest();
Expand Down
4 changes: 2 additions & 2 deletions tests/booking_option_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function tearDown(): void {
* @covers \mod_booking\option\field_base->check_for_changes
* @throws \coding_exception
*/
public function test_option_changes() {
final public function test_option_changes(): void {

$bdata = ['name' => 'Test Booking', 'eventtype' => 'Test event',
'bookedtext' => ['text' => 'text'], 'waitingtext' => ['text' => 'text'],
Expand Down Expand Up @@ -201,7 +201,7 @@ public function test_option_changes() {
* @throws \coding_exception
* @throws \dml_exception
*/
public function test_delete_responses_activitycompletion() {
final public function test_delete_responses_activitycompletion(): void {
global $DB, $CFG;

$CFG->enablecompletion = 1;
Expand Down
4 changes: 2 additions & 2 deletions tests/booking_rules/rules_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function tearDown(): void {
* @covers \mod_booking\placeholders\placeholders\changes->return_value
* @throws \coding_exception
*/
public function test_rule_on_booking_option_update() {
final public function test_rule_on_booking_option_update(): void {

$bdata = ['name' => 'Test Booking', 'eventtype' => 'Test event',
'bookedtext' => ['text' => 'text'], 'waitingtext' => ['text' => 'text'],
Expand Down Expand Up @@ -181,7 +181,7 @@ public function test_rule_on_booking_option_update() {
* @covers \mod_booking\placeholders\placeholders\changes->return_value
* @throws \coding_exception
*/
public function test_rule_on_beforeafter_cursestart() {
final public function test_rule_on_beforeafter_cursestart(): void {

set_config('timezone', 'Europe/Kyiv');
set_config('forcetimezone', 'Europe/Kyiv');
Expand Down
4 changes: 2 additions & 2 deletions tests/event/events_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private function returntestdata() {
* @covers \mod_booking\event\teacher_added
* @throws \coding_exception
*/
public function test_teacher_added() {
final public function test_teacher_added(): void {

list($user1, $option, $coursectx) = $this->returntestdata();

Expand Down Expand Up @@ -143,7 +143,7 @@ public function test_teacher_added() {
* @covers \mod_booking\event\teacher_removed
* @throws \coding_exception
*/
public function test_teacher_removed() {
final public function test_teacher_removed(): void {

list($user1, $option, $coursectx) = $this->returntestdata();

Expand Down
2 changes: 1 addition & 1 deletion tests/importer/booking_importer_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function tearDown(): void {
* @throws \coding_exception
* @throws \dml_exception
*/
public function test_csv_import_process_data() {
final public function test_csv_import_process_data(): void {
$this->resetAfterTest();
// It is important to set timezone to have all dates correct!
$this->setTimezone('Europe/London');
Expand Down
2 changes: 1 addition & 1 deletion tests/lib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function tearDown(): void {
* @throws \coding_exception
* @throws \dml_exception
*/
public function test_subscribe_teacher_to_booking_option() {
final public function test_subscribe_teacher_to_booking_option(): void {

global $DB;

Expand Down
2 changes: 1 addition & 1 deletion tests/shopping_cart/shopping_cart_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function tearDown(): void {
* @dataProvider booking_common_settings_provider
*
*/
public function test_booking_bookit_with_price_and_installment() {
final public function test_booking_bookit_with_price_and_installment(): void {
global $DB, $CFG;

// Skip this test if shopping_cart not installed.
Expand Down
2 changes: 1 addition & 1 deletion tests/task/send_reminder_mails_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function tearDown(): void {
* @throws \coding_exception
* @throws \dml_exception
*/
public function test_send_teacher_remimder() {
final public function test_send_teacher_remimder(): void {
global $DB, $CFG;

// It is important to set timezone to have all dates correct!
Expand Down

0 comments on commit f084c63

Please sign in to comment.