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

(-)a/t/db_dependent/Koha/Items/BatchUpdate.t (-2 / +28 lines)
Lines 16-22 Link Here
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
use Test::More tests=> 7;
19
use Test::More tests=> 8;
20
use Test::Warn;
20
use utf8;
21
use utf8;
21
22
22
use Koha::Database;
23
use Koha::Database;
Lines 27-32 use Koha::Item::Attributes; Link Here
27
use Koha::MarcSubfieldStructures;
28
use Koha::MarcSubfieldStructures;
28
29
29
use t::lib::TestBuilder;
30
use t::lib::TestBuilder;
31
use t::lib::Mocks;
30
32
31
my $schema = Koha::Database->new->schema;
33
my $schema = Koha::Database->new->schema;
32
$schema->storage->txn_begin;
34
$schema->storage->txn_begin;
Lines 252-257 subtest 'encoding' => sub { Link Here
252
    is( $item->as_marc_field->subfield('é'), 'new note é', );
254
    is( $item->as_marc_field->subfield('é'), 'new note é', );
253
};
255
};
254
256
257
subtest 'mark_items_returned' => sub {
258
    plan tests => 2;
259
260
    my $circ = Test::MockModule->new( 'C4::Circulation' );
261
    $circ->mock( 'MarkIssueReturned', sub {
262
        warn "MarkIssueReturned";
263
    });
264
265
    my $issue = $builder->build_object({class => 'Koha::Checkouts'});
266
    my $items = Koha::Items->search({ itemnumber => $issue->itemnumber });
267
268
    warning_is
269
        { $items->batch_update({new_values => {},mark_items_returned => 1}) }
270
        qq{MarkIssueReturned},
271
        "MarkIssueReturned called for item";
272
273
    $items->reset;
274
275
    warning_is
276
        { $items->batch_update({new_values => {},mark_items_returned => 0}) }
277
        qq{},
278
        "MarkIssueReturned not called for item";
279
280
};
281
255
subtest 'report' => sub {
282
subtest 'report' => sub {
256
    plan tests => 5;
283
    plan tests => 5;
257
284
258
- 

Return to bug 32019