|
Lines 17-26
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 2; |
20 |
use Test::More; |
| 21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
| 22 |
use Test::Mojo; |
22 |
use Test::Mojo; |
| 23 |
|
23 |
|
|
|
24 |
use Module::Load::Conditional qw(can_load); |
| 25 |
|
| 26 |
use Koha::ApiKeys; |
| 24 |
use Koha::Database; |
27 |
use Koha::Database; |
| 25 |
use Koha::Patrons; |
28 |
use Koha::Patrons; |
| 26 |
|
29 |
|
|
Lines 31-37
my $t = Test::Mojo->new('Koha::REST::V1');
Link Here
|
| 31 |
my $schema = Koha::Database->new->schema; |
34 |
my $schema = Koha::Database->new->schema; |
| 32 |
my $builder = t::lib::TestBuilder->new(); |
35 |
my $builder = t::lib::TestBuilder->new(); |
| 33 |
|
36 |
|
|
|
37 |
if ( can_load( modules => { 'Net::OAuth2::AuthorizationServer' => undef } ) ) { |
| 38 |
plan tests => 2; |
| 39 |
} |
| 40 |
else { |
| 41 |
plan skip_all => 'Net::OAuth2::AuthorizationServer not available'; |
| 42 |
} |
| 43 |
|
| 34 |
subtest '/oauth/token tests' => sub { |
44 |
subtest '/oauth/token tests' => sub { |
|
|
45 |
|
| 35 |
plan tests => 27; |
46 |
plan tests => 27; |
| 36 |
|
47 |
|
| 37 |
$schema->storage->txn_begin; |
48 |
$schema->storage->txn_begin; |
| 38 |
- |
|
|