Bug 40429: Remove warnings from Koha/Patron/Modifications.t
t/db_dependent/Koha/Patron/Modifications.t .. 1/7 DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'borrowernumber' on BorrowerModification - perhaps you forgot to set its 'is_auto_increme nt' attribute during add_columns()? Treating 'borrowernumber' implicitly as an autoinc, and attempting value retrieval at /kohadevbox/koha/Koha/Object.pm line 174 t/db_dependent/Koha/Patron/Modifications.t .. 5/7 DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'verification_token' on BorrowerModification - perhaps you forgot to set its 'is_auto_inc rement' attribute during add_columns()? Treating 'verification_token' implicitly as an autoinc, and attempting value retrieval at /kohadevbox/koha/Koha/Object.pm line 174 Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> (cherry picked from commitf851367cf4) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> (cherry picked from commit0bd9f325c8) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
9338678ae4
commit
0d08141eb1
|
|
@ -19,7 +19,8 @@ use Modern::Perl;
|
|||
|
||||
use utf8;
|
||||
|
||||
use Test::More tests => 7;
|
||||
use Test::More tests => 8;
|
||||
use Test::NoWarnings;
|
||||
use Test::Exception;
|
||||
|
||||
use t::lib::TestBuilder;
|
||||
|
|
@ -49,9 +50,13 @@ subtest 'new() tests' => sub {
|
|||
|
||||
Koha::Patron::Modifications->search->delete;
|
||||
|
||||
my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
|
||||
|
||||
# Create new pending modification
|
||||
Koha::Patron::Modification->new(
|
||||
{ verification_token => '1234567890',
|
||||
{
|
||||
borrowernumber => $patron->borrowernumber,
|
||||
verification_token => '1234567890',
|
||||
changed_fields => 'surname,firstname',
|
||||
surname => 'Hall',
|
||||
firstname => 'Kyle'
|
||||
|
|
@ -391,8 +396,11 @@ subtest 'dateofbirth tests' => sub {
|
|||
$schema->storage->txn_begin;
|
||||
|
||||
# Cleaning the field
|
||||
my $patron = $builder->build_object( { class => 'Koha::Patrons', value => { dateofbirth => '1980-01-01', surname => 'a_surname' } } );
|
||||
my $patron_modification = Koha::Patron::Modification->new( {
|
||||
my $patron = $builder->build_object(
|
||||
{ class => 'Koha::Patrons', value => { dateofbirth => '1980-01-01', surname => 'a_surname' } } );
|
||||
my $patron_modification = Koha::Patron::Modification->new(
|
||||
{
|
||||
verification_token => '1234567890',
|
||||
changed_fields => 'borrowernumber,dateofbirth',
|
||||
borrowernumber => $patron->borrowernumber,
|
||||
dateofbirth => undef
|
||||
|
|
@ -406,7 +414,9 @@ subtest 'dateofbirth tests' => sub {
|
|||
Koha::Patron::Modifications->search({ borrowernumber => $patron->borrowernumber })->delete;
|
||||
|
||||
# Adding a dateofbirth
|
||||
$patron_modification = Koha::Patron::Modification->new( {
|
||||
$patron_modification = Koha::Patron::Modification->new(
|
||||
{
|
||||
verification_token => '1234567890',
|
||||
changed_fields => 'borrowernumber,dateofbirth',
|
||||
borrowernumber => $patron->borrowernumber,
|
||||
dateofbirth => '1980-02-02'
|
||||
|
|
@ -421,7 +431,9 @@ subtest 'dateofbirth tests' => sub {
|
|||
Koha::Patron::Modifications->search({ borrowernumber => $patron->borrowernumber })->delete;
|
||||
|
||||
# Modifying a dateofbirth
|
||||
$patron_modification = Koha::Patron::Modification->new( {
|
||||
$patron_modification = Koha::Patron::Modification->new(
|
||||
{
|
||||
verification_token => '1234567890',
|
||||
changed_fields => 'borrowernumber,dateofbirth',
|
||||
borrowernumber => $patron->borrowernumber,
|
||||
dateofbirth => '1980-03-03',
|
||||
|
|
@ -437,7 +449,9 @@ subtest 'dateofbirth tests' => sub {
|
|||
Koha::Patron::Modifications->search({ borrowernumber => $patron->borrowernumber })->delete;
|
||||
|
||||
# Modifying something else
|
||||
$patron_modification = Koha::Patron::Modification->new( {
|
||||
$patron_modification = Koha::Patron::Modification->new(
|
||||
{
|
||||
verification_token => '1234567890',
|
||||
changed_fields => 'borrowernumber,surname',
|
||||
borrowernumber => $patron->borrowernumber,
|
||||
surname => 'another_surname',
|
||||
|
|
|
|||
Loading…
Reference in New Issue