Bugzilla – Attachment 117547 Details for
Bug 27833
Koha::Exceptions::Patron::Attribute::* should have parameters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27833: Add unit tests
Bug-27833-Add-unit-tests.patch (text/plain), 2.31 KB, created by
David Nind
on 2021-03-02 19:02:47 UTC
(
hide
)
Description:
Bug 27833: Add unit tests
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-03-02 19:02:47 UTC
Size:
2.31 KB
patch
obsolete
>From 4a7d89d4d33db85804e9fd558a973c5c2f4c4162 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 2 Mar 2021 11:06:35 -0300 >Subject: [PATCH] Bug 27833: Add unit tests > >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/Koha/Patron/Attributes.t | 22 ++++++++++++++++++++-- > 1 file changed, 20 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Patron/Attributes.t b/t/db_dependent/Koha/Patron/Attributes.t >index e403e0d30e..92e5cd05fb 100755 >--- a/t/db_dependent/Koha/Patron/Attributes.t >+++ b/t/db_dependent/Koha/Patron/Attributes.t >@@ -33,7 +33,7 @@ my $builder = t::lib::TestBuilder->new; > > subtest 'store() repeatable attributes tests' => sub { > >- plan tests => 4; >+ plan tests => 5; > > $schema->storage->txn_begin; > >@@ -84,6 +84,15 @@ subtest 'store() repeatable attributes tests' => sub { > } > 'Koha::Exceptions::Patron::Attribute::NonRepeatable', > 'Exception thrown trying to store more than one non-repeatable attribute'; >+ >+ is( >+ "$@", >+ "Tried to add more than one non-repeatable attributes. code=" >+ . $attribute_type_2->{code} >+ . " attribute=Bar", >+ 'Exception stringified correctly, attribute passed correctly' >+ ); >+ > my $attributes = Koha::Patron::Attributes->search( > { borrowernumber => $patron, code => $attribute_type_2->{code} } ); > is( $attributes->count, 1, '1 non-repeatable attribute stored' ); >@@ -95,7 +104,7 @@ subtest 'store() repeatable attributes tests' => sub { > > subtest 'store() unique_id attributes tests' => sub { > >- plan tests => 4; >+ plan tests => 5; > > $schema->storage->txn_begin; > >@@ -148,6 +157,15 @@ subtest 'store() unique_id attributes tests' => sub { > } > 'Koha::Exceptions::Patron::Attribute::UniqueIDConstraint', > 'Exception thrown trying to store more than one unique attribute'; >+ >+ is( >+ "$@", >+ "Your action breaks a unique constraint on the attribute. code=" >+ . $attribute_type_2->{code} >+ . " attribute=Foo", >+ 'Exception stringified correctly, attribute passed correctly' >+ ); >+ > my $attributes = Koha::Patron::Attributes->search( > { borrowernumber => $patron_1, code => $attribute_type_2->{code} } ); > is( $attributes->count, 1, '1 unique attribute stored' ); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27833
:
117516
|
117517
|
117518
|
117546
|
117547
|
117548
|
117676
|
117701
|
117702
|
117703
|
117704