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

(-)a/t/db_dependent/Koha/Patrons.t (-2 / +35 lines)
Lines 1865-1871 subtest 'Test Koha::Patrons::merge' => sub { Link Here
1865
};
1865
};
1866
1866
1867
subtest '->store' => sub {
1867
subtest '->store' => sub {
1868
    plan tests => 7;
1868
    plan tests => 8;
1869
    my $schema = Koha::Database->new->schema;
1869
    my $schema = Koha::Database->new->schema;
1870
    $schema->storage->txn_begin;
1870
    $schema->storage->txn_begin;
1871
1871
Lines 1921-1926 subtest '->store' => sub { Link Here
1921
        is($logs->count, 0, '->store should not have generated a log for updated_on') or diag 'Log generated:'.Dumper($logs->unblessed);
1921
        is($logs->count, 0, '->store should not have generated a log for updated_on') or diag 'Log generated:'.Dumper($logs->unblessed);
1922
        $schema->storage->txn_rollback;
1922
        $schema->storage->txn_rollback;
1923
    };
1923
    };
1924
1925
    subtest 'create user usage' => sub {
1926
        plan tests => 1;
1927
        $schema->storage->txn_begin;
1928
1929
        my $library = $builder->build_object( { class => 'Koha::Libraries' } );
1930
        my $patron_category = $builder->build_object(
1931
            {
1932
                class => 'Koha::Patron::Categories',
1933
                value => { category_type => 'P', enrolmentfee => 0 }
1934
            }
1935
        );
1936
        my %data = (
1937
            cardnumber   => "123456789",
1938
            firstname    => "Tômàsító",
1939
            surname      => "Ñoné",
1940
            password     => 'Funk3y',
1941
            categorycode => $patron_category->categorycode,
1942
            branchcode   => $library->branchcode,
1943
        );
1944
1945
        # Enable notifying patrons of password changes for these tests
1946
        t::lib::Mocks::mock_preference( 'NotifyPasswordChange', 1 );
1947
        my $new_patron     = Koha::Patron->new( \%data )->store();
1948
        my $queued_notices = Koha::Notice::Messages->search(
1949
            { borrowernumber => $new_patron->borrowernumber }
1950
        );
1951
        is(
1952
            $queued_notices->count, 0,
1953
            "No notice queued when NotifyPasswordChange enabled and this is a new patron"
1954
        );
1955
1956
        $schema->storage->txn_rollback;
1957
    };
1924
};
1958
};
1925
1959
1926
subtest '->set_password' => sub {
1960
subtest '->set_password' => sub {
1927
- 

Return to bug 25936