View | Details | Raw Unified | Return to bug 21975
Collapse All | Expand All

(-)a/t/db_dependent/Items/AutomaticItemModificationByAge.t (-3 / +10 lines)
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 12-17 use C4::Biblio; Link Here
12
use C4::Context;
12
use C4::Context;
13
use Koha::DateUtils;
13
use Koha::DateUtils;
14
use Koha::Items;
14
use Koha::Items;
15
use t::lib::Mocks;
15
use t::lib::TestBuilder;
16
use t::lib::TestBuilder;
16
17
17
my $schema = Koha::Database->new->schema;
18
my $schema = Koha::Database->new->schema;
Lines 297-305 C4::Items::ToggleNewStatus( { rules => \@rules } ); Link Here
297
$modified_item = Koha::Items->find( $itemnumber );
298
$modified_item = Koha::Items->find( $itemnumber );
298
is( $modified_item->new_status, 'another_new_updated_value', q|ToggleNewStatus: conditions on biblioitems|);
299
is( $modified_item->new_status, 'another_new_updated_value', q|ToggleNewStatus: conditions on biblioitems|);
299
300
300
# Clear cache
301
# Run twice
302
t::lib::Mocks::mock_preference('CataloguingLog', 1);
303
my $actions_nb = $schema->resultset('ActionLog')->count();
304
C4::Items::ToggleNewStatus( { rules => \@rules } );
305
is( $schema->resultset('ActionLog')->count(), $actions_nb, q|ToggleNewStatus: no substitution does not generate action logs|);
306
307
# Cleanup
301
$cache = Koha::Caches->get_instance();
308
$cache = Koha::Caches->get_instance();
302
$cache->clear_from_cache("MarcStructure-0-$frameworkcode");
309
$cache->clear_from_cache("MarcStructure-0-$frameworkcode");
303
$cache->clear_from_cache("MarcStructure-1-$frameworkcode");
310
$cache->clear_from_cache("MarcStructure-1-$frameworkcode");
304
$cache->clear_from_cache("default_value_for_mod_marc-");
311
$cache->clear_from_cache("default_value_for_mod_marc-");
305
$cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
312
$cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
306
- 
313
$schema->storage->txn_rollback;

Return to bug 21975