Lines 390-396
subtest "to_api_mapping() tests" => sub {
Link Here
|
390 |
|
390 |
|
391 |
subtest "from_api_mapping() tests" => sub { |
391 |
subtest "from_api_mapping() tests" => sub { |
392 |
|
392 |
|
393 |
plan tests => 3; |
393 |
plan tests => 5; |
394 |
|
394 |
|
395 |
$schema->storage->txn_begin; |
395 |
$schema->storage->txn_begin; |
396 |
|
396 |
|
Lines 449-454
subtest "from_api_mapping() tests" => sub {
Link Here
|
449 |
'Fresh mapping loaded' |
449 |
'Fresh mapping loaded' |
450 |
); |
450 |
); |
451 |
|
451 |
|
|
|
452 |
$city_class->unmock( 'to_api_mapping'); |
453 |
$city_class->mock( 'to_api_mapping', undef ); |
454 |
|
455 |
# Get a fresh object |
456 |
$city = $builder->build_object({ class => 'Koha::Cities' }); |
457 |
is_deeply( |
458 |
$city->from_api_mapping, |
459 |
{}, |
460 |
'No to_api_mapping then empty hashref' |
461 |
); |
462 |
|
463 |
$city_class->unmock( 'to_api_mapping'); |
464 |
$city_class->mock( 'to_api_mapping', sub { return; } ); |
465 |
|
466 |
# Get a fresh object |
467 |
$city = $builder->build_object({ class => 'Koha::Cities' }); |
468 |
is_deeply( |
469 |
$city->from_api_mapping, |
470 |
{}, |
471 |
'Empty to_api_mapping then empty hashref' |
472 |
); |
473 |
|
452 |
$schema->storage->txn_rollback; |
474 |
$schema->storage->txn_rollback; |
453 |
}; |
475 |
}; |
454 |
|
476 |
|
455 |
- |
|
|