Bugzilla – Attachment 165790 Details for
Bug 35657
Add ability to assign tickets to librarians for catalog concerns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35657: Unit tests for relation accessor additions
Bug-35657-Unit-tests-for-relation-accessor-additio.patch (text/plain), 2.85 KB, created by
Martin Renvoize (ashimema)
on 2024-04-29 17:56:21 UTC
(
hide
)
Description:
Bug 35657: Unit tests for relation accessor additions
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-29 17:56:21 UTC
Size:
2.85 KB
patch
obsolete
>From b9dbafbf39528cacd262b5e72d9a98e9d8472593 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 26 Apr 2024 14:24:08 +0100 >Subject: [PATCH] Bug 35657: Unit tests for relation accessor additions > >This patch adds the unit tests for the new 'assignee' relation accessors >added to Koha::Ticket and Koha::Ticket::Update classes. > >Signed-off-by: Paul Derscheid <paulderscheid@gmail.com> >--- > t/db_dependent/Koha/Ticket.t | 23 ++++++++++++++++++++++- > t/db_dependent/Koha/Ticket/Update.t | 23 ++++++++++++++++++++++- > 2 files changed, 44 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Ticket.t b/t/db_dependent/Koha/Ticket.t >index 7734f6de676..cc1798ef190 100755 >--- a/t/db_dependent/Koha/Ticket.t >+++ b/t/db_dependent/Koha/Ticket.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 7; >+use Test::More tests => 8; > use t::lib::TestBuilder; > use t::lib::Mocks; > >@@ -51,6 +51,27 @@ subtest 'reporter() tests' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'assignee() tests' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $ticket = $builder->build_object( >+ { >+ class => 'Koha::Tickets', >+ value => { assignee_id => $patron->id } >+ } >+ ); >+ >+ my $assignee = $ticket->assignee; >+ is( ref($assignee), 'Koha::Patron', 'Koha::Ticket->assignee returns a Koha::Patron object' ); >+ is( $assignee->id, $patron->id, 'Koha::Ticket->assignee returns the right Koha::Patron' ); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'resolver() tests' => sub { > > plan tests => 2; >diff --git a/t/db_dependent/Koha/Ticket/Update.t b/t/db_dependent/Koha/Ticket/Update.t >index ebd1b4997dc..ec33fa89fc7 100755 >--- a/t/db_dependent/Koha/Ticket/Update.t >+++ b/t/db_dependent/Koha/Ticket/Update.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 3; >+use Test::More tests => 4; > use t::lib::TestBuilder; > > use Koha::Database; >@@ -73,6 +73,27 @@ subtest 'user() tests' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'assignee() tests' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $assignee = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $update = $builder->build_object( >+ { >+ class => 'Koha::Ticket::Updates', >+ value => { assignee_id => $assignee->id } >+ } >+ ); >+ >+ my $linked_assignee = $update->assignee; >+ is( ref($linked_assignee), 'Koha::Patron', 'Koha::Ticket::Update->assignee returns a Koha::Patron object' ); >+ is( $linked_assignee->id, $assignee->id, 'Koha::Ticket::Update->assignee returns the right Koha::Patron' ); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'strings_map() tests' => sub { > plan tests => 16; > >-- >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 35657
:
160365
|
160366
|
160367
|
160368
|
160369
|
160372
|
160373
|
160374
|
160375
|
160376
|
160377
|
164923
|
164924
|
164925
|
164926
|
164927
|
164928
|
164932
|
164933
|
164934
|
164935
|
164974
|
164975
|
164976
|
164977
|
165666
|
165667
|
165668
|
165669
|
165670
|
165671
|
165672
|
165673
|
165674
|
165675
|
165676
|
165677
|
165678
|
165679
|
165786
|
165787
|
165788
|
165789
|
165790
|
165791
|
165792
|
165878
|
165879
|
165880
|
165881
|
165882
|
165883
|
165884
|
165885
|
165886
|
166067