Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 12; |
22 |
use Test::More tests => 13; |
23 |
use Test::Mojo; |
23 |
use Test::Mojo; |
24 |
use t::lib::TestBuilder; |
24 |
use t::lib::TestBuilder; |
25 |
|
25 |
|
Lines 34-39
use Koha::Items;
Link Here
|
34 |
|
34 |
|
35 |
my $builder = t::lib::TestBuilder->new(); |
35 |
my $builder = t::lib::TestBuilder->new(); |
36 |
|
36 |
|
|
|
37 |
subtest 'Swagger item-definition and Koha::Item' => sub { |
38 |
plan tests => 2; |
39 |
|
40 |
use_ok("Swagger2"); |
41 |
my $swagger = Swagger2->new(C4::Context->config('intranetdir')."/api/v1/swagger.json")->expand; |
42 |
my $api_spec = $swagger->api_spec->data; |
43 |
|
44 |
my $properties = $api_spec->{definitions}->{"item"}->{properties}; |
45 |
my @columns = Koha::Item->new->_result->columns; |
46 |
my @missing; |
47 |
foreach my $column (@columns) { |
48 |
push @missing, $column unless $properties->{$column}; |
49 |
} |
50 |
|
51 |
is(join(', ' , @missing), "", "Item definition up-to-date with Koha::Item columns."); |
52 |
}; |
53 |
|
37 |
my $dbh = C4::Context->dbh; |
54 |
my $dbh = C4::Context->dbh; |
38 |
$dbh->{AutoCommit} = 0; |
55 |
$dbh->{AutoCommit} = 0; |
39 |
$dbh->{RaiseError} = 1; |
56 |
$dbh->{RaiseError} = 1; |
40 |
- |
|
|