|
Lines 127-133
subtest 'get() tests' => sub {
Link Here
|
| 127 |
|
127 |
|
| 128 |
subtest 'restore() tests' => sub { |
128 |
subtest 'restore() tests' => sub { |
| 129 |
|
129 |
|
| 130 |
plan tests => 11; |
130 |
plan tests => 15; |
| 131 |
|
131 |
|
| 132 |
$schema->storage->txn_begin; |
132 |
$schema->storage->txn_begin; |
| 133 |
|
133 |
|
|
Lines 183-187
subtest 'restore() tests' => sub {
Link Here
|
| 183 |
|
183 |
|
| 184 |
$t->put_ok("//$userid:$password@/api/v1/deleted/items/$item_id")->status_is(404); |
184 |
$t->put_ok("//$userid:$password@/api/v1/deleted/items/$item_id")->status_is(404); |
| 185 |
|
185 |
|
|
|
186 |
my $item_without_biblio = $builder->build_sample_item( { barcode => 'TEST_NO_BIBLIO' } ); |
| 187 |
my $orphan_item_id = $item_without_biblio->itemnumber; |
| 188 |
my $orphan_biblio_id = $item_without_biblio->biblionumber; |
| 189 |
my $orphan_item_data = $item_without_biblio->unblessed; |
| 190 |
my $deleted_orphan_item = Koha::Old::Item->new($orphan_item_data)->store; |
| 191 |
$item_without_biblio->delete; |
| 192 |
Koha::Biblios->find($orphan_biblio_id)->delete; |
| 193 |
|
| 194 |
$t->put_ok("//$userid:$password@/api/v1/deleted/items/$orphan_item_id")->status_is(409)->json_has('/error') |
| 195 |
->json_like( '/error', qr/Bibliographic record not found/ ); |
| 196 |
|
| 186 |
$schema->storage->txn_rollback; |
197 |
$schema->storage->txn_rollback; |
| 187 |
}; |
198 |
}; |
| 188 |
- |
|
|