5 eval "use DBIx::Class::CDBICompat;";
6 plan skip_all => 'Class::Trigger and DBIx::ContextualFetch required' if $@;
8 eval "use DBD::SQLite";
9 plan skip_all => 'needs DBD::SQLite for testing' if $@;
13 use lib 't/cdbi/testlib';
25 my($self, $key, $val) = @_;
27 return $self->{$key} = $val;
31 my $film = Film->create({ Title => "No Wolf McQuade" });
33 # Test mk_group_accessors() with a list of fields.
35 Film->mk_group_accessors(test => qw(foo bar));
44 # An explicit accessor passed to mk_group_accessors should
45 # ignore accessor/mutator_name_for.
46 sub Film::accessor_name_for {
47 my($class, $col) = @_;
48 return "hlaglagh" if $col eq "wibble";
52 sub Film::mutator_name_for {
53 my($class, $col) = @_;
54 return "hlaglagh" if $col eq "wibble";
59 # Test with a mix of fields and field specs
61 Film->mk_group_accessors(test => ("baz", [wibble_thing => "wibble"]));
65 $film->wibble_thing(23);
66 is $film->wibble_thing, 23;