9 use Text::Tradition::Directory;
11 my $mysql_connect_info = $ENV{TT_MYSQL_TEST};
12 plan skip_all => 'Please set TT_MYSQL_TEST to an appropriate db to run this test'
13 unless $mysql_connect_info;
15 my @dbconnect = split( /;/, $mysql_connect_info );
16 my $dsn = 'dbi:mysql:';
19 foreach my $item ( @dbconnect ) {
20 my( $k, $v ) = split( /=/, $item );
23 } elsif( $k eq 'password' ) {
30 my $dir = Text::Tradition::Directory->new( 'dsn' => $dsn,
31 'extra_args' => { 'user' => $user, 'password' => $pass,
32 dbi_attrs => { 'mysql_enable_utf8' => 1 } },
35 my $scope = $dir->new_scope();
37 my $utf8_t = Text::Tradition->new(
39 'file' => 't/data/florilegium_graphml.xml' );
40 my $uuid = $dir->save( $utf8_t );
41 foreach my $tinfo( $dir->traditionlist ) {
42 next unless $tinfo->{id} eq $uuid;
43 like( $tinfo->{name}, qr/\x{3b2}/, "Tradition name encoded correctly" );