Proyectos de Subversion Moodle

Rev

Rev 11 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11 Rev 1441
Línea 34... Línea 34...
34
 * @package    core_payment
34
 * @package    core_payment
35
 * @category   test
35
 * @category   test
36
 * @copyright  2020 Marina Glancy
36
 * @copyright  2020 Marina Glancy
37
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
37
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
38
 */
38
 */
39
class helper_test extends advanced_testcase {
39
final class helper_test extends advanced_testcase {
Línea 40... Línea 40...
40
 
40
 
41
    protected function enable_paypal_gateway(): bool {
41
    protected function enable_paypal_gateway(): bool {
42
        if (!array_key_exists('paypal', \core_component::get_plugin_list('paygw'))) {
42
        if (!array_key_exists('paypal', \core_component::get_plugin_list('paygw'))) {
43
            return false;
43
            return false;
Línea 135... Línea 135...
135
    /**
135
    /**
136
     * Provider for format_cost test
136
     * Provider for format_cost test
137
     *
137
     *
138
     * @return array
138
     * @return array
139
     */
139
     */
140
    public function get_rounded_cost_provider(): array {
140
    public static function get_rounded_cost_provider(): array {
141
        return [
141
        return [
142
            'IRR 0 surcharge' => [5.345, 'IRR', 0, 5],
142
            'IRR 0 surcharge' => [5.345, 'IRR', 0, 5],
143
            'IRR 12% surcharge' => [5.345, 'IRR', 12, 6],
143
            'IRR 12% surcharge' => [5.345, 'IRR', 12, 6],
144
            'USD 0 surcharge' => [5.345, 'USD', 0, 5.34],
144
            'USD 0 surcharge' => [5.345, 'USD', 0, 5.34],
145
            'USD 1% surcharge' => [5.345, 'USD', 1, 5.4],
145
            'USD 1% surcharge' => [5.345, 'USD', 1, 5.4],
Línea 149... Línea 149...
149
    /**
149
    /**
150
     * Provider for test_get_cost_as_string
150
     * Provider for test_get_cost_as_string
151
     *
151
     *
152
     * @return array[]
152
     * @return array[]
153
     */
153
     */
154
    public function get_cost_as_string_provider(): array {
154
    public static function get_cost_as_string_provider(): array {
155
        return [
155
        return [
156
            'IRR 0 surcharge' => [5.345, 'IRR', 0, 'IRR'."\xc2\xa0".'5'],
156
            'IRR 0 surcharge' => [5.345, 'IRR', 0, 'IRR'."\xc2\xa0".'5'],
157
            'IRR 12% surcharge' => [5.345, 'IRR', 12, 'IRR'."\xc2\xa0".'6'],
157
            'IRR 12% surcharge' => [5.345, 'IRR', 12, 'IRR'."\xc2\xa0".'6'],
158
            'USD 0 surcharge' => [5.345, 'USD', 0, 'USD'."\xc2\xa0".'5.34'],
158
            'USD 0 surcharge' => [5.345, 'USD', 0, 'USD'."\xc2\xa0".'5.34'],
159
            'USD 1% surcharge' => [5.345, 'USD', 1, 'USD'."\xc2\xa0".'5.40'],
159
            'USD 1% surcharge' => [5.345, 'USD', 1, 'USD'."\xc2\xa0".'5.40'],