Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 12; |
22 |
use Test::More tests => 13; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
use File::Basename qw(dirname); |
24 |
use File::Basename qw(dirname); |
25 |
|
25 |
|
Lines 332-338
subtest 'Date handling' => sub {
Link Here
|
332 |
my $patron = $builder->build( { source => 'Borrower' } ); |
332 |
my $patron = $builder->build( { source => 'Borrower' } ); |
333 |
is( length( $patron->{updated_on} ), 19, 'A timestamp column value should be YYYY-MM-DD HH:MM:SS' ); |
333 |
is( length( $patron->{updated_on} ), 19, 'A timestamp column value should be YYYY-MM-DD HH:MM:SS' ); |
334 |
is( length( $patron->{dateofbirth} ), 10, 'A date column value should be YYYY-MM-DD' ); |
334 |
is( length( $patron->{dateofbirth} ), 10, 'A date column value should be YYYY-MM-DD' ); |
335 |
|
|
|
336 |
}; |
335 |
}; |
337 |
|
336 |
|
338 |
subtest 'Default values' => sub { |
337 |
subtest 'Default values' => sub { |
Lines 391-394
subtest 'build_object() tests' => sub {
Link Here
|
391 |
}; |
390 |
}; |
392 |
}; |
391 |
}; |
393 |
|
392 |
|
|
|
393 |
subtest '->build parameter' => sub { |
394 |
plan tests => 2; |
395 |
|
396 |
# Test to make sure build() warns user of unknown parameters. |
397 |
warnings_are { |
398 |
$builder->build({ |
399 |
source => 'Branch', |
400 |
values => { |
401 |
branchcode => 'BRANCH_1' |
402 |
} |
403 |
}) |
404 |
} [], "No warnings on correct use"; |
405 |
|
406 |
warnings_like { |
407 |
$builder->build({ |
408 |
source => 'Branch', |
409 |
branchcode => 'BRANCH_2' # This is wrong! |
410 |
}) |
411 |
} qr/unknown param/i, "Carp unknown parameters"; |
412 |
}; |
413 |
|
394 |
$schema->storage->txn_rollback; |
414 |
$schema->storage->txn_rollback; |
395 |
- |
|
|