View | Details | Raw Unified | Return to bug 37856
Collapse All | Expand All

(-)a/t/db_dependent/Koha/ERM/EUsage/UsageDataProvider.t (-2 / +36 lines)
Lines 29-35 my $builder = t::lib::TestBuilder->new; Link Here
29
29
30
subtest '_build_url_query' => sub {
30
subtest '_build_url_query' => sub {
31
31
32
    plan tests => 1;
32
    plan tests => 2;
33
33
34
    $schema->storage->txn_begin;
34
    $schema->storage->txn_begin;
35
35
Lines 70-75 subtest '_build_url_query' => sub { Link Here
70
            . substr( $usage_data_provider->{end_date}, 0, 7 )
70
            . substr( $usage_data_provider->{end_date}, 0, 7 )
71
    );
71
    );
72
72
73
    my $test_platform = 'www.whatever.com';
74
75
    my $usage_data_provider_with_platform = $builder->build_object(
76
        {
77
            class => 'Koha::ERM::EUsage::UsageDataProviders',
78
            value => {
79
                service_url => $service_url, api_key => $api_key, requestor_id => $requestor_id,
80
                customer_id => $customer_id, name    => $name, service_platform => $test_platform
81
            }
82
        }
83
    );
84
85
    $usage_data_provider_with_platform->{report_type} = 'TR_J1';
86
    $usage_data_provider_with_platform->{begin_date}  = '2023-08-01';
87
    $usage_data_provider_with_platform->{end_date}    = '2023-09-30';
88
89
    is(
90
        $usage_data_provider_with_platform->_build_url_query,
91
        $service_url
92
            . '/reports/'
93
            . lc( $usage_data_provider->{report_type} )
94
            . '?customer_id='
95
            . $customer_id
96
            . '&requestor_id='
97
            . $requestor_id
98
            . '&api_key='
99
            . $api_key
100
            . '&begin_date='
101
            . substr( $usage_data_provider->{begin_date}, 0, 7 )
102
            . '&end_date='
103
            . substr( $usage_data_provider->{end_date}, 0, 7 )
104
            . '&platform='
105
            . $test_platform
106
    );
107
73
    $schema->storage->txn_rollback;
108
    $schema->storage->txn_rollback;
74
109
75
};
110
};
76
- 

Return to bug 37856