Rose::DBx::Object::I18N. Rename due to CPAN convention. Documentation. Preparing...
[blog.pm-common-perl-mods.git] / Rose-DBx-Object-I18N / t / is-original.t
blob4481c1f7d980b825bc9c1ec361656bf575278847
1 #! /usr/bin/perl
3 use strict;
4 use warnings;
6 use Test::More 'tests' => 4;
8 use lib 't/lib';
10 use NewDB;
11 use User;
12 use User::Manager;
14 my $db = NewDB->new();
16 $db->init();
18 my $u = User->new(
19 name => 'asdf',
20 orig_lang => 'ru',
21 signature => 'hello'
23 $u->save();
25 $u = User->new( id => $u->id );
26 $u->load( i18n => 'ru' );
27 ok( $u->is_original );
29 $u->load_i18n( language => 'en' );
30 ok( $u->is_original );
32 $u->i18n->signature( 'hello2' );
33 $u->save();
34 is( $u->i18n->istran, 1 );
36 ok( !$u->is_original );
38 $u->delete( cascade => 1 );