Bugzilla – Attachment 164881 Details for
Bug 36593
Add support for the `time` column type on TestBuilder
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36593: Add 'time' column type support to TestBuilder
Bug-36593-Add-time-column-type-support-to-TestBuil.patch (text/plain), 1.81 KB, created by
Martin Renvoize (ashimema)
on 2024-04-15 13:07:44 UTC
(
hide
)
Description:
Bug 36593: Add 'time' column type support to TestBuilder
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-15 13:07:44 UTC
Size:
1.81 KB
patch
obsolete
>From 3b427e3f66e545a40b32407d757cf83a992f1262 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 15 Apr 2024 06:56:53 -0300 >Subject: [PATCH] Bug 36593: Add 'time' column type support to TestBuilder > >This simple patch adds support for the 'time' column type. > >To test: >1. Run: > $ ktd --shell > k$ perl -Mt::lib::TestBuilder -e 'my $b = t::lib::TestBuilder->new; my >$hour = $b->build_object({ class => "Koha::Library::Hours" });' >=> FAIL: It explodes as it doesn't know how to deal with the 'time' >column type >2. Apply this patch and the follow-up >3. Run: > k$ prove -MDDP -Mt::lib::TestBuilder -e 'my $b = >t::lib::TestBuilder->new; my $h = $b->build_object({ class => "Koha::Library::Hours" }); p($h->unblessed);' >=> SUCCESS: It generates an hour! >4. Run: > k$ prove t/db_dependent/TestBuilder.t >=> SUCCESS: It builds all the things! >5. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/lib/TestBuilder.pm | 6 ++++++ > 1 file changed, 6 insertions(+) > >diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm >index 91fb518494c..d01cf580643 100644 >--- a/t/lib/TestBuilder.pm >+++ b/t/lib/TestBuilder.pm >@@ -467,6 +467,7 @@ sub _gen_type { > decimal => \&_gen_real, > double_precision => \&_gen_real, > >+ time => \&_gen_time, > timestamp => \&_gen_datetime, > datetime => \&_gen_datetime, > date => \&_gen_date, >@@ -536,6 +537,11 @@ sub _gen_datetime { > return $self->schema->storage->datetime_parser->format_datetime(dt_from_string); > } > >+sub _gen_time { >+ my ( $self, $params ) = @_; >+ return $self->schema->storage->datetime_parser->format_time(dt_from_string); >+} >+ > sub _gen_text { > my ($self, $params) = @_; > # From perldoc String::Random >-- >2.44.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 36593
:
164871
|
164872
| 164881 |
164882