Bugzilla – Attachment 52335 Details for
Bug 16500
Catch two warns in TestBuilder.t with warning_like
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16500: Catch two warns in TestBuilder.t with warning_like
Bug-16500-Catch-two-warns-in-TestBuildert-with-war.patch (text/plain), 1.77 KB, created by
Jonathan Druart
on 2016-06-13 16:49:04 UTC
(
hide
)
Description:
Bug 16500: Catch two warns in TestBuilder.t with warning_like
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-06-13 16:49:04 UTC
Size:
1.77 KB
patch
obsolete
>From 69becedbd74d4bb603131ad47c509fc4b08d13a0 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 11 May 2016 14:49:07 +0200 >Subject: [PATCH] Bug 16500: Catch two warns in TestBuilder.t with warning_like > >When testing a wrong case in TestBuilder.t, two warns show up. >We can catch them with warning_like. > >Test plan: >Run t/db_dependent/TestBuilder.t > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/TestBuilder.t | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/TestBuilder.t b/t/db_dependent/TestBuilder.t >index 0baec38..724f32d 100644 >--- a/t/db_dependent/TestBuilder.t >+++ b/t/db_dependent/TestBuilder.t >@@ -54,7 +54,9 @@ subtest 'Start with some trivial tests' => sub { > # return undef if a record exists > my $param = { source => 'Branch', value => { branchcode => 'MPL' } }; > $builder->build( $param ); # at least it should exist now >- is( $builder->build( $param ), undef, 'Return undef when exists' ); >+ warning_like { $builder->build( $param ) } >+ qr/Violation of unique constraint/, >+ 'Catch warn on adding existing record'; > }; > > >@@ -229,7 +231,9 @@ subtest 'Test build with NULL values' => sub { > > # PK should not be null > my $params = { source => 'Branch', value => { branchcode => undef }}; >- is( $builder->build( $params ), undef, 'PK should not be null' ); >+ warning_like { $builder->build( $params ) } >+ qr/Null value for branchcode/, >+ 'Catch warn on adding branch with a null branchcode'; > # Nullable column > my $info = $schema->source( 'Item' )->column_info( 'barcode' ); > $params = { source => 'Item', value => { barcode => undef }}; >-- >2.8.1
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 16500
:
51437
|
51770
|
51851
|
52229
|
52300
|
52335
|
52336
|
52337