Removed BasicRels and reorganized where the various init/setup code resides.
[dbsrgits/DBIx-Class.git] / t / run / 25utf8.tl
1 sub run_tests {
2     my $schema = shift;
3
4     eval 'use Encode ; 1'
5         or plan skip_all, 'Install Encode run this test';
6
7     plan tests => 2;
8
9     DBICTest::Schema::Artist->load_components('UTF8Columns');
10     DBICTest::Schema::Artist->utf8_columns('name');
11     Class::C3->reinitialize();
12
13     my $artist = $schema->resultset("Artist")->create( { name => 'uni' } );
14     ok( Encode::is_utf8( $artist->name ), 'got name with utf8 flag' );
15
16     my $utf8_char = 'uniuni';
17     Encode::_utf8_on($utf8_char);
18     $artist->name($utf8_char);
19     ok( !Encode::is_utf8( $artist->{_column_data}->{name} ),
20         'store utf8 less chars' );
21 }
22
23 1;