Lines 79-92
my $article_request = Koha::ArticleRequest->new(
Link Here
|
79 |
$article_request = Koha::ArticleRequests->find( $article_request->id ); |
79 |
$article_request = Koha::ArticleRequests->find( $article_request->id ); |
80 |
ok( $article_request->id, 'Koha::ArticleRequest created' ); |
80 |
ok( $article_request->id, 'Koha::ArticleRequest created' ); |
81 |
|
81 |
|
82 |
is( $article_request->status, Koha::ArticleRequest::Status::Open, 'New article request has status of Open' ); |
82 |
is( $article_request->status, Koha::ArticleRequest::Status::Pending, 'New article request has status of Open' ); |
83 |
$article_request->process(); |
83 |
$article_request->process(); |
84 |
is( $article_request->status, Koha::ArticleRequest::Status::Processing, '$ar->process() changes status to Processing' ); |
84 |
is( $article_request->status, Koha::ArticleRequest::Status::Processing, '$ar->process() changes status to Processing' ); |
85 |
$article_request->complete(); |
85 |
$article_request->complete(); |
86 |
is( $article_request->status, Koha::ArticleRequest::Status::Completed, '$ar->complete() changes status to Completed' ); |
86 |
is( $article_request->status, Koha::ArticleRequest::Status::Completed, '$ar->complete() changes status to Completed' ); |
87 |
$article_request->cancel(); |
87 |
$article_request->cancel(); |
88 |
is( $article_request->status, Koha::ArticleRequest::Status::Canceled, '$ar->complete() changes status to Canceled' ); |
88 |
is( $article_request->status, Koha::ArticleRequest::Status::Canceled, '$ar->complete() changes status to Canceled' ); |
89 |
$article_request->status(Koha::ArticleRequest::Status::Open); |
89 |
$article_request->status(Koha::ArticleRequest::Status::Pending); |
90 |
$article_request->store(); |
90 |
$article_request->store(); |
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' ); |
Lines 105-111
is( $patron->article_requests_current()->count(), 0, 'Completed request not retu
Link Here
|
105 |
$article_request->cancel(); |
105 |
$article_request->cancel(); |
106 |
is( $patron->article_requests_current()->count(), 0, 'Canceled request not returned for article_requests_current' ); |
106 |
is( $patron->article_requests_current()->count(), 0, 'Canceled request not returned for article_requests_current' ); |
107 |
|
107 |
|
108 |
$article_request->status(Koha::ArticleRequest::Status::Open); |
108 |
$article_request->status(Koha::ArticleRequest::Status::Pending); |
109 |
$article_request->store(); |
109 |
$article_request->store(); |
110 |
|
110 |
|
111 |
is( $patron->article_requests_finished()->count(), 0, 'Open request returned for article_requests_finished' ); |
111 |
is( $patron->article_requests_finished()->count(), 0, 'Open request returned for article_requests_finished' ); |
Lines 115-121
$article_request->complete();
Link Here
|
115 |
$article_request->cancel(); |
115 |
$article_request->cancel(); |
116 |
is( $patron->article_requests_finished()->count(), 1, 'Canceled request not returned for article_requests_finished' ); |
116 |
is( $patron->article_requests_finished()->count(), 1, 'Canceled request not returned for article_requests_finished' ); |
117 |
|
117 |
|
118 |
$article_request->status(Koha::ArticleRequest::Status::Open); |
118 |
$article_request->status(Koha::ArticleRequest::Status::Pending); |
119 |
$article_request->store(); |
119 |
$article_request->store(); |
120 |
|
120 |
|
121 |
$ar = $biblio->article_requests(); |
121 |
$ar = $biblio->article_requests(); |
Lines 130-136
is( $biblio->article_requests_current()->count(), 0, 'Completed request not retu
Link Here
|
130 |
$article_request->cancel(); |
130 |
$article_request->cancel(); |
131 |
is( $biblio->article_requests_current()->count(), 0, 'Canceled request not returned for article_requests_current' ); |
131 |
is( $biblio->article_requests_current()->count(), 0, 'Canceled request not returned for article_requests_current' ); |
132 |
|
132 |
|
133 |
$article_request->status(Koha::ArticleRequest::Status::Open); |
133 |
$article_request->status(Koha::ArticleRequest::Status::Pending); |
134 |
$article_request->store(); |
134 |
$article_request->store(); |
135 |
|
135 |
|
136 |
is( $biblio->article_requests_finished()->count(), 0, 'Open request returned for article_requests_finished' ); |
136 |
is( $biblio->article_requests_finished()->count(), 0, 'Open request returned for article_requests_finished' ); |
137 |
- |
|
|