skip tests unless DBD::SQLite installed
[blog.pm-common-perl-mods.git] / Rose-DBx-Object-I18N / t / delete-i18n.t
blob64ce389ed40fa39e77e8ae29b7cd9b8574a29ee8
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' => 3;
13 use lib 't/lib';
15 use NewDB;
16 use User;
18 my $db = NewDB->new();
20 $db->init();
22 my $u = User->new(
23 name => 'qqqqa',
24 orig_lang => 'ru',
25 signature => 'hello'
27 $u->save();
29 $u->i18n( 'en' )->signature( 'hallo' );
30 $u->save();
31 is( $u->i18n->istran, 1 );
33 $u->delete_i18n();
34 is( $u->i18n->istran, 0 );
36 is( $u->i18n->signature, 'hello' );
38 $u->delete( cascade => 1 );