|
Lines 23-29
use Test::More tests => 49;
Link Here
|
| 23 |
use Koha::Database; |
23 |
use Koha::Database; |
| 24 |
|
24 |
|
| 25 |
use Koha::Biblio; |
25 |
use Koha::Biblio; |
| 26 |
use Koha::Borrower; |
26 |
use Koha::Patron; |
| 27 |
use Koha::Library; |
27 |
use Koha::Library; |
| 28 |
|
28 |
|
| 29 |
BEGIN { |
29 |
BEGIN { |
|
Lines 61-73
ok( $item->id, 'Koha::Item created' );
Link Here
|
| 61 |
|
61 |
|
| 62 |
my $branch = Koha::Libraries->search()->next(); |
62 |
my $branch = Koha::Libraries->search()->next(); |
| 63 |
my $category = $schema->resultset('Category')->next(); |
63 |
my $category = $schema->resultset('Category')->next(); |
| 64 |
my $patron = Koha::Borrower->new( |
64 |
my $patron = Koha::Patron->new( |
| 65 |
{ |
65 |
{ |
| 66 |
categorycode => $category->id, |
66 |
categorycode => $category->id, |
| 67 |
branchcode => $branch->id, |
67 |
branchcode => $branch->id, |
| 68 |
} |
68 |
} |
| 69 |
)->store(); |
69 |
)->store(); |
| 70 |
ok( $patron->id, 'Koha::Borrower created' ); |
70 |
ok( $patron->id, 'Koha::Patron created' ); |
| 71 |
|
71 |
|
| 72 |
my $article_request = Koha::ArticleRequest->new( |
72 |
my $article_request = Koha::ArticleRequest->new( |
| 73 |
{ |
73 |
{ |
|
Lines 91-97
$article_request->store();
Link Here
|
| 91 |
|
91 |
|
| 92 |
is( $article_request->biblio->id, $biblio->id, '$ar->biblio() gets corrosponding Koha::Biblio object' ); |
92 |
is( $article_request->biblio->id, $biblio->id, '$ar->biblio() gets corrosponding Koha::Biblio object' ); |
| 93 |
is( $article_request->item->id, $item->id, '$ar->item() gets corrosponding Koha::Item object' ); |
93 |
is( $article_request->item->id, $item->id, '$ar->item() gets corrosponding Koha::Item object' ); |
| 94 |
is( $article_request->borrower->id, $patron->id, '$ar->borrower() gets corrosponding Koha::Borrower object' ); |
94 |
is( $article_request->borrower->id, $patron->id, '$ar->borrower() gets corrosponding Koha::Patron object' ); |
| 95 |
|
95 |
|
| 96 |
my $ar = $patron->article_requests(); |
96 |
my $ar = $patron->article_requests(); |
| 97 |
is( ref($ar), 'Koha::ArticleRequests', '$patron->article_requests returns Koha::ArticleRequests object' ); |
97 |
is( ref($ar), 'Koha::ArticleRequests', '$patron->article_requests returns Koha::ArticleRequests object' ); |
| 98 |
- |
|
|