Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 68 lines (56 sloc) 1.404 kb
561f003 _is_deteministic_value
Guillermo Roditi authored
1 use strict;
2 use warnings;
3
c959e8d @lukesaunders skipped test which relies on module if module isn't present
lukesaunders authored
4 use Test::More;
68de943 @ribasushi Massive cleanup of DateTime test dependencies, other interim
ribasushi authored
5 use Test::Exception;
6
4bea1fe @ribasushi Add startup sanity check of the ::DBI::Replicated method dispatch tables
ribasushi authored
7 use lib qw(t/lib);
8 use DBICTest;
9
68de943 @ribasushi Massive cleanup of DateTime test dependencies, other interim
ribasushi authored
10 BEGIN {
11 require DBIx::Class;
12 plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_dt')
13 unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_dt');
14 }
15
561f003 _is_deteministic_value
Guillermo Roditi authored
16 my $schema = DBICTest->init_schema();
17 my $artist_rs = $schema->resultset('Artist');
18 my $cd_rs = $schema->resultset('CD');
19
20 {
21 my $cd;
22 lives_ok {
23 $cd = $cd_rs->search({ year => {'=' => 1999}})->create
24 ({
25 artist => {name => 'Guillermo1'},
26 title => 'Guillermo 1',
27 });
28 };
29 is($cd->year, 1999);
30 }
31
32 {
33 my $formatter = DateTime::Format::Strptime->new(pattern => '%Y');
34 my $dt = DateTime->new(year => 2006, month => 06, day => 06,
35 formatter => $formatter );
36 my $cd;
37 lives_ok {
38 $cd = $cd_rs->search({ year => $dt})->create
39 ({
40 artist => {name => 'Guillermo2'},
41 title => 'Guillermo 2',
42 });
43 };
44 is($cd->year, 2006);
45 }
46
47
48 {
49 my $artist;
50 lives_ok {
51 $artist = $artist_rs->search({ name => {'!=' => 'Killer'}})
52 ->create({artistid => undef});
53 };
54 is($artist->name, undef);
55 }
56
57
58 {
59 my $artist;
60 lives_ok {
1de5406 @shadowcat-mst fix test to use qw as (so far as I can see) originally intended
shadowcat-mst authored
61 $artist = $artist_rs->search({ name => [ qw(some stupid names here) ]})
561f003 _is_deteministic_value
Guillermo Roditi authored
62 ->create({artistid => undef});
63 };
64 is($artist->name, undef);
65 }
66
89bddb4 @ribasushi Convert all no_plan tests to done_testing
ribasushi authored
67 done_testing;
Something went wrong with that request. Please try again.