1package Film; 2 3BEGIN { unshift @INC, './t/cdbi-t/testlib'; } 4use base 'Class::DBI::Test::SQLite'; 5use strict; 6 7__PACKAGE__->set_table('Movies'); 8__PACKAGE__->columns('Primary', 'Title'); 9__PACKAGE__->columns('Essential', qw( Title )); 10__PACKAGE__->columns('Directors', qw( Director CoDirector )); 11__PACKAGE__->columns('Other', qw( Rating NumExplodingSheep HasVomit )); 12 13sub create_sql { 14 return qq{ 15 title VARCHAR(255), 16 director VARCHAR(80), 17 codirector VARCHAR(80), 18 rating CHAR(5), 19 numexplodingsheep INTEGER, 20 hasvomit CHAR(1) 21 } 22} 23 24sub create_test_film { 25 return shift->insert( 26 { 27 Title => 'Bad Taste', 28 Director => 'Peter Jackson', 29 Rating => 'R', 30 NumExplodingSheep => 1, 31 } 32 ); 33} 34 35package DeletingFilm; 36 37use base 'Film'; 38sub DESTROY { shift->delete } 39 401; 41 42