skip tests unless DBD::SQLite installed
[blog.pm-common-perl-mods.git] / Rose-DBx-Object-I18N / t / delete.t
blob02a4924aaf6bc2b6c43aea202686b5c42d0ad37f
1 #!/usr/bin/perl
3 use strict;
4 use warnings;
6 use Test::More;
8 eval "use DBD::SQLite";
9 plan skip_all => "DBD::SQLite is required to run this test" if $@;
11 plan 'tests' => 4;
13 use lib 't/lib';
15 use NewDB;
16 use User;
17 use User::Manager;
19 my $db = NewDB->new();
21 $db->init();
23 my $u = User->new(
24 name => 'qqqq',
25 orig_lang => 'ru',
26 signature => 'hello'
28 $u->save();
30 $u = User->new( id => $u->id );
31 $u->load();
32 my @i18n = @{ $u->user_i18n };
34 $u->delete( cascade => 1 );
36 $u = User->new( id => $u->id );
37 $u->load( speculative => 1 );
38 ok( $u->not_found );
40 foreach my $i18n ( @i18n ) {
41 $u = UserI18N->new( i18nid => $i18n->i18nid );
42 $u->load( speculative => 1 );
43 ok( $u->not_found );