Lines 1-7
Link Here
|
1 |
#!/usr/bin/perl |
1 |
#!/usr/bin/perl |
2 |
|
2 |
|
3 |
use Modern::Perl; |
3 |
use Modern::Perl; |
4 |
use Test::More tests => 16; |
4 |
use Test::More tests => 17; |
5 |
use MARC::Record; |
5 |
use MARC::Record; |
6 |
use MARC::Field; |
6 |
use MARC::Field; |
7 |
use DateTime; |
7 |
use DateTime; |
Lines 11-16
use C4::Items;
Link Here
|
11 |
use C4::Biblio; |
11 |
use C4::Biblio; |
12 |
use C4::Context; |
12 |
use C4::Context; |
13 |
use Koha::DateUtils; |
13 |
use Koha::DateUtils; |
|
|
14 |
use t::lib::Mocks; |
14 |
use t::lib::TestBuilder; |
15 |
use t::lib::TestBuilder; |
15 |
|
16 |
|
16 |
my $schema = Koha::Database->new->schema; |
17 |
my $schema = Koha::Database->new->schema; |
Lines 298-306
C4::Items::ToggleNewStatus( { rules => \@rules } );
Link Here
|
298 |
$modified_item = C4::Items::GetItem( $itemnumber ); |
299 |
$modified_item = C4::Items::GetItem( $itemnumber ); |
299 |
is( $modified_item->{new_status}, 'another_new_updated_value', q|ToggleNewStatus: conditions on biblioitems|); |
300 |
is( $modified_item->{new_status}, 'another_new_updated_value', q|ToggleNewStatus: conditions on biblioitems|); |
300 |
|
301 |
|
301 |
# Clear cache |
302 |
# Run twice |
|
|
303 |
t::lib::Mocks::mock_preference('CataloguingLog', 1); |
304 |
my $actions_nb = $schema->resultset('ActionLog')->count(); |
305 |
C4::Items::ToggleNewStatus( { rules => \@rules } ); |
306 |
is( $schema->resultset('ActionLog')->count(), $actions_nb, q|ToggleNewStatus: no substitution does not generate action logs|); |
307 |
|
308 |
# Cleanup |
302 |
$cache = Koha::Caches->get_instance(); |
309 |
$cache = Koha::Caches->get_instance(); |
303 |
$cache->clear_from_cache("MarcStructure-0-$frameworkcode"); |
310 |
$cache->clear_from_cache("MarcStructure-0-$frameworkcode"); |
304 |
$cache->clear_from_cache("MarcStructure-1-$frameworkcode"); |
311 |
$cache->clear_from_cache("MarcStructure-1-$frameworkcode"); |
305 |
$cache->clear_from_cache("default_value_for_mod_marc-"); |
312 |
$cache->clear_from_cache("default_value_for_mod_marc-"); |
306 |
$cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); |
313 |
$cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); |
307 |
- |
314 |
$schema->storage->txn_rollback; |