X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F100populate.t;h=e179931281e6933ebc686671684d5486b5b5cade;hb=d2f4cc4a86585dbaf0bda33cf9c1d4403b6397a4;hp=994524e814cbe13288524a258772533340efe85c;hpb=c0d8cb1fa36945ace1bb09bba48a5e9ee60ddc6e;p=dbsrgits%2FDBIx-Class.git diff --git a/t/100populate.t b/t/100populate.t index 994524e..e179931 100644 --- a/t/100populate.t +++ b/t/100populate.t @@ -258,4 +258,62 @@ for ( ok ($row, "Stringification test row '$_' properly inserted"); } +$rs->delete; + +# test stringification with ->create rather than Storage::insert_bulk as well + +lives_ok { + my @dummy = $rs->populate([ + { + name => 'supplied before stringifying object', + }, + { + name => $fn, + } + ]); +} 'stringifying objects pass through'; + +# ... and vice-versa. + +lives_ok { + my @dummy = $rs->populate([ + { + name => $fn2, + }, + { + name => 'supplied after stringifying object', + }, + ]); +} 'stringifying objects pass through'; + +for ( + $fn, + $fn2, + 'supplied after stringifying object', + 'supplied before stringifying object' +) { + my $row = $rs->find ({name => $_}); + ok ($row, "Stringification test row '$_' properly inserted"); +} + +lives_ok { + $schema->resultset('TwoKeys')->populate([{ + artist => 1, + cd => 5, + fourkeys_to_twokeys => [{ + f_foo => 1, + f_bar => 1, + f_hello => 1, + f_goodbye => 1, + autopilot => 'a', + },{ + f_foo => 2, + f_bar => 2, + f_hello => 2, + f_goodbye => 2, + autopilot => 'b', + }] + }]) +} 'multicol-PK has_many populate works'; + done_testing;