[Bug 18182] New: TestBuilder should be able to return Koha::Object objects
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Bug ID: 18182 Summary: TestBuilder should be able to return Koha::Object objects Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: tomascohen@gmail.com QA Contact: gmcharlt@gmail.com There's a common pattern in most tests we write: my $object_hash = $builder->build({ source => 'TheSchema', value => { fixed => values, ... } }); my $id = $object->{the_id_field}; my $object = Koha::Objects->find($id); < the actual tests > It would be handy to have TestBuilder provide a way to actually retrieve the Koha::Object instance. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 60819 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60819&action=edit Bug 18182: Make TestBuilder capable of returning Koha::Object This patch adds a new method to t::lib::TestBuilder so it can return Koha::Object-derived objects. The new method is called ->build_object and requires the plural of the target class to be passed, along with the field to be used as id on searching the object. The plural is because the singular form is not aware of its plural (I always thought we should move plural stuff into the singular class, this is one of the reasons). The id is required because that's the way to find the recently created object. If any of those parameters is ommited, a warning is raised and undef is returned. To test: - Apply the patches - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/TestBuilder.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: ByWater Solutions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 60820 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60820&action=edit Bug 18182: (followup) Add POD -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Great, Tomas. Few remarks: I would rather remove the id column. We c/should take care of that in the code. Like: my @pk = $schema->source('Borrower')->primary_columns; Note that we theoretically can have multiple columns. (We don't have such Koha objects, but iirc we have one or two tables like that.) Similarly, it would be more consistent and less confusing to use the singular form. We do so in build; I would expect the same for build_object. Additionally, you return just one singular object. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #3)
Great, Tomas.
Few remarks: I would rather remove the id column. We c/should take care of that in the code. Like: my @pk = $schema->source('Borrower')->primary_columns; Note that we theoretically can have multiple columns. (We don't have such Koha objects, but iirc we have one or two tables like that.)
I agree. Read the next answer to have context.
Similarly, it would be more consistent and less confusing to use the singular form. We do so in build; I would expect the same for build_object. Additionally, you return just one singular object.
Singular classes are not aware of the plural class name. And we need the plural to ->find the created object. That's the design decision I don't like about koha::object(s). I'm open to opinions, but the only solutions are -annotate singular classes so they know their plural -move the plural methods to the singular classes and get rid of plural I vote for the latter, of course. But that would be a bigger dev. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #4)
Singular classes are not aware of the plural class name. And we need the plural to ->find the created object. That's the design decision I don't like about koha::object(s). I'm open to opinions, but the only solutions are -annotate singular classes so they know their plural -move the plural methods to the singular classes and get rid of plural
I vote for the latter, of course. But that would be a bigger dev.
Did you look at this one: sub _get_objects_class $ git grep koha_objects_class Koha/Objects.pm: if( $type->can('koha_objects_class') ) { Koha/Objects.pm: return $type->koha_objects_class; Koha/Schema/Result/Borrower.pm:sub koha_objects_class { Koha/Schema/Result/Branch.pm:sub koha_objects_class { Koha/Schema/Result/OldIssue.pm:sub koha_objects_class { So cool :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #5)
(In reply to Tomás Cohen Arazi from comment #4)
Singular classes are not aware of the plural class name. And we need the plural to ->find the created object. That's the design decision I don't like about koha::object(s). I'm open to opinions, but the only solutions are -annotate singular classes so they know their plural -move the plural methods to the singular classes and get rid of plural
I vote for the latter, of course. But that would be a bigger dev.
Did you look at this one: sub _get_objects_class $ git grep koha_objects_class Koha/Objects.pm: if( $type->can('koha_objects_class') ) { Koha/Objects.pm: return $type->koha_objects_class; Koha/Schema/Result/Borrower.pm:sub koha_objects_class { Koha/Schema/Result/Branch.pm:sub koha_objects_class { Koha/Schema/Result/OldIssue.pm:sub koha_objects_class {
So cool :)
So we annotate our singular classes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #60819|0 |1 is obsolete| | Attachment #60820|0 |1 is obsolete| | --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 61702 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61702&action=edit Bug 18182: Make TestBuilder capable of returning Koha::Object This patch adds a new method to t::lib::TestBuilder so it can return Koha::Object-derived objects. The new method is called ->build_object and requires the plural of the target class to be passed. 'class' is a mandatory param, and a warning is raised and undef is returned if absent. It accepts 'value' as the original ->build() method, and that is passed as-is to ->build(). To test: - Apply the patches - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/TestBuilder.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: ByWater Solutions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle.m.hall@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Marcel, I thought a bit more about this and... (In reply to Marcel de Rooy from comment #3)
Great, Tomas.
Few remarks: I would rather remove the id column. We c/should take care of that in the code. Like: my @pk = $schema->source('Borrower')->primary_columns; Note that we theoretically can have multiple columns. (We don't have such Koha objects, but iirc we have one or two tables like that.)
I fixed it so the id is retrieved from the source. I did it so multi-pk works as expected, and changed the tests so they use a multi key sample Koha::Object.
Similarly, it would be more consistent and less confusing to use the singular form. We do so in build; I would expect the same for build_object. Additionally, you return just one singular object.
I decided not to do it, but instead enforce the idea that plurals should be used. I even changed the wiki about this. Because singular vs. plural leads (everywhere) to circular deps (boo). And so we need to ONLY include plurals everywhere. The plural already loads the singular, so it will always be available. This should be explained more bradly, but I think we should leave the plural here to simplify things. I hope you agree and we move this forward, as it will make writing tests more seamless. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=13906 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- $categorycode, 'Firstname correctly set' ); LOL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- This line in Koha::Objects prevents us from just sending @pks to find: my $result = $self->_resultset()->find($id); Koha::Objects here assumes one id, which is not correct. Since Koha::IssuingRule has a composite primary key. Your workaround is fine, but I think we should solve this on a new report. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61702|0 |1 is obsolete| | --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 61752 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61752&action=edit Bug 18182: Make TestBuilder capable of returning Koha::Object This patch adds a new method to t::lib::TestBuilder so it can return Koha::Object-derived objects. The new method is called ->build_object and requires the plural of the target class to be passed. 'class' is a mandatory param, and a warning is raised and undef is returned if absent. It accepts 'value' as the original ->build() method, and that is passed as-is to ->build(). To test: - Apply the patches - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/TestBuilder.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: ByWater Solutions Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 61753 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61753&action=edit Bug 18182: [QA Follow-up] Fix a few typos, consistent rollback Since we here only use one rollback and this test does not care, it is more consistent to keep that pattern. Additionally, promoting two globals to our. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #8)
I decided not to do it, but instead enforce the idea that plurals should be used. I even changed the wiki about this. Because singular vs. plural leads (everywhere) to circular deps (boo). And so we need to ONLY include plurals everywhere. The plural already loads the singular, so it will always be available. This should be explained more bradly, but I think we should leave the plural here to simplify things.
OK. Not sure if we should call it a circular dependency btw, since it is fully OO. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |18361 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 [Bug 18361] Koha::Objects->find should accept composite primary keys -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 62113 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62113&action=edit Bug 18182: Tests all Koha::Objects-based modules -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 62114 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62114&action=edit Bug 18182: Fix Koha::RefundLostItemFeeRules -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #16 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I have added tests, but one fails on 'Koha::Serial::Item'. Could you take a look? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #17 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #16)
I have added tests, but one fails on 'Koha::Serial::Item'. Could you take a look?
CREATE TABLE `serialitems` ( `itemnumber` int(11) NOT NULL, `serialid` int(11) NOT NULL, UNIQUE KEY `serialitemsidx` (`itemnumber`), KEY `serialitems_sfk_1` (`serialid`), CONSTRAINT `serialitems_sfk_1` FOREIGN KEY (`serialid`) REFERENCES `serial` (`serialid`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `serialitems_sfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE ) Serialitems should have a primary key. Since itemnumber is a unique key, we could promote it to PK as well. Should be solved on a different report. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #62113|0 |1 is obsolete| | --- Comment #18 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 62121 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62121&action=edit Bug 18182: Tests all Koha::Objects-based modules Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Added test description on line 387. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #62114|0 |1 is obsolete| | --- Comment #19 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 62122 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62122&action=edit Bug 18182: Fix Koha::RefundLostItemFeeRules Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18427 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #20 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #17)
Serialitems should have a primary key. Since itemnumber is a unique key, we could promote it to PK as well. Should be solved on a different report.
Solved on bug 18427 now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|gmcharlt@gmail.com |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also|https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18427 | Depends on| |18427 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18427 [Bug 18427] Add a primary key to serialitems -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61752|0 |1 is obsolete| | --- Comment #21 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 62371 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62371&action=edit Bug 18182: Make TestBuilder capable of returning Koha::Object This patch adds a new method to t::lib::TestBuilder so it can return Koha::Object-derived objects. The new method is called ->build_object and requires the plural of the target class to be passed. 'class' is a mandatory param, and a warning is raised and undef is returned if absent. It accepts 'value' as the original ->build() method, and that is passed as-is to ->build(). To test: - Apply the patches - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/TestBuilder.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: ByWater Solutions Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61753|0 |1 is obsolete| | --- Comment #22 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 62372 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62372&action=edit Bug 18182: [QA Follow-up] Fix a few typos, consistent rollback Since we here only use one rollback and this test does not care, it is more consistent to keep that pattern. Additionally, promoting two globals to our. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #62121|0 |1 is obsolete| | --- Comment #23 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 62373 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62373&action=edit Bug 18182: Tests all Koha::Objects-based modules Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Added test description on line 387. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #62122|0 |1 is obsolete| | --- Comment #24 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 62374 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62374&action=edit Bug 18182: Fix Koha::RefundLostItemFeeRules Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #62371|0 |1 is obsolete| | Attachment #62372|0 |1 is obsolete| | Attachment #62373|0 |1 is obsolete| | Attachment #62374|0 |1 is obsolete| | --- Comment #25 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 62383 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62383&action=edit Bug 18182: Make TestBuilder capable of returning Koha::Object This patch adds a new method to t::lib::TestBuilder so it can return Koha::Object-derived objects. The new method is called ->build_object and requires the plural of the target class to be passed. 'class' is a mandatory param, and a warning is raised and undef is returned if absent. It accepts 'value' as the original ->build() method, and that is passed as-is to ->build(). To test: - Apply the patches - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/TestBuilder.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: ByWater Solutions Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #26 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 62384 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62384&action=edit Bug 18182: [QA Follow-up] Fix a few typos, consistent rollback Since we here only use one rollback and this test does not care, it is more consistent to keep that pattern. Additionally, promoting two globals to our. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #27 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 62385 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62385&action=edit Bug 18182: Tests all Koha::Objects-based modules Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Added test description on line 387. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 --- Comment #28 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 62386 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62386&action=edit Bug 18182: Fix Koha::RefundLostItemFeeRules Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |kyle@bywatersolutions.com --- Comment #29 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Tomas, Marcel, Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Bug 18182 depends on bug 18427, which changed state. Bug 18427 Summary: Add a primary key to serialitems https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18427 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Status|Pushed to Master |RESOLVED Resolution|--- |FIXED --- Comment #30 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This won't get ported back to 16.11.x as it is an enhancement. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |18339 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18339 [Bug 18339] Koha::Patron::Attribute ->opac_editable and ->opac_display should be removed -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org