@@ -67,17 +67,13 @@ public function test_course_cost() {
67
67
public function test_detectsubplugins () {
68
68
$ this ->resetAfterTest ();
69
69
70
- $ gateways = \tool_paymentplugin \plugininfo \paymentgateway::get_all_gateway_objects ();
71
- // Test gateway detection.
72
- $ this ->assertEquals (2 , count ($ gateways ), "The gateway is not detected. " );
73
70
// Test disabled by default.
74
71
$ this ->assertEquals (0 , count (\tool_paymentplugin \plugininfo \paymentgateway::get_all_enabled_gateway_objects ()),
75
72
"The gateway is not disabled " );
76
73
77
74
// Test enable configs.
78
75
set_config ('enabled ' , 1 , 'paymentgateway_paypal ' );
79
- set_config ('enabled ' , 1 , 'paymentgateway_credit ' );
80
- $ this ->assertEquals (2 , count (\tool_paymentplugin \plugininfo \paymentgateway::get_all_enabled_gateway_objects ()),
76
+ $ this ->assertEquals (1 , count (\tool_paymentplugin \plugininfo \paymentgateway::get_all_enabled_gateway_objects ()),
81
77
"Configs are not enabled. " );
82
78
83
79
// Test disable all config.
@@ -86,11 +82,8 @@ public function test_detectsubplugins() {
86
82
"All configs are not disabled " );
87
83
88
84
set_config ('disableall ' , 0 , 'tool_paymentplugin ' );
89
- $ this ->assertEquals (2 , count (\tool_paymentplugin \plugininfo \paymentgateway::get_all_enabled_gateway_objects ()),
85
+ $ this ->assertEquals (1 , count (\tool_paymentplugin \plugininfo \paymentgateway::get_all_enabled_gateway_objects ()),
90
86
"All configs are not disabled " );
91
87
92
- // Test gateways are not blank.
93
- $ this ->assertEquals ($ gateways [0 ]->name , 'credit ' , "gateway[credit] name is invaild " );
94
- $ this ->assertEquals ($ gateways [1 ]->name , 'paypal ' , "gateway[name] name is invaild " );
95
88
}
96
89
}
0 commit comments