7 eval "use DBIx::Class::CDBICompat;";
8 plan skip_all => 'Class::Trigger and DBIx::ContextualFetch required' if $@;
10 eval "use DBD::SQLite";
11 plan skip_all => 'needs DBD::SQLite for testing' if $@;
29 my($self, $key, $val) = @_;
31 return $self->{$key} = $val;
35 my $film = Film->create({ Title => "No Wolf McQuade" });
37 # Test mk_group_accessors() with a list of fields.
39 Film->mk_group_accessors(test => qw(foo bar));
48 # An explicit accessor passed to mk_group_accessors should
49 # ignore accessor/mutator_name_for.
50 sub Film::accessor_name_for {
51 my($class, $col) = @_;
52 return "hlaglagh" if $col eq "wibble";
56 sub Film::mutator_name_for {
57 my($class, $col) = @_;
58 return "hlaglagh" if $col eq "wibble";
63 # Test with a mix of fields and field specs
65 Film->mk_group_accessors(test => ("baz", [wibble_thing => "wibble"]));
69 $film->wibble_thing(23);
70 is $film->wibble_thing, 23;