diff --git a/t/19-populate-unicode.t b/t/19-populate-unicode.t index ab5fce1..adc76f9 100644 --- a/t/19-populate-unicode.t +++ b/t/19-populate-unicode.t @@ -7,10 +7,19 @@ use DBICTest; use Path::Class; use Data::Dumper; use IO::All; -use utf8; +use Test::mysqld; +use utf8::all; +use feature 'unicode_strings'; # set up and populate schema -ok( my $schema = DBICTest->init_schema(), 'got schema' ); + +plan skip_all => 'Set $ENV{FIXTURETEST_DSN}, _USER and _PASS to point at MySQL DB to run this test' + unless ($ENV{FIXTURETEST_DSN}); + +ok( my $schema = DBICTest->init_schema( dsn => $ENV{FIXTURETEST_DSN}, user => $ENV{FIXTURETEST_USER}, pass => $ENV{FIXTURETEST_PASS} ) ); + +#ok( my $schema = DBICTest->init_schema(), 'got schema' ); + my $config_dir = io->catfile(qw't var configs')->name; # do dump @@ -24,6 +33,10 @@ ok( 'object created with correct config dir' ); +# DBI::mysql:database=test;host=localhost;port=5624 + + + DBICTest->clear_schema($schema); DBICTest->populate_schema($schema); @@ -37,10 +50,10 @@ ok( ), "unicode dump executed okay" ); - +DBICTest->clear_schema($schema); $fixtures->populate( { - connection_details => [ 'dbi:SQLite:' . io->catfile(qw[ t var DBIxClass.db ])->name, '', '' ], + connection_details => [ $ENV{FIXTURETEST_DSN}, $ENV{FIXTURETEST_USER}, $ENV{FIXTURETEST_PASS} ], directory => io->catfile(qw't var fixtures')->name, schema => $schema, no_deploy => 1, @@ -51,3 +64,7 @@ $fixtures->populate( my $cd = $schema->resultset('CD')->find( { cdid => 5 }); is($cd->title, "Unicode Chars ™ © • † ∑ α β « » → …", "Unicode chars found"); + +my $umlaute_cd = $schema->resultset('CD')->find( { cdid => 6 } ); + +is($umlaute_cd->title, "Übertreibung älterer Umlaute", "German special chars are correctly imported"); diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index 8b6d155..61f0991 100755 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -66,7 +66,7 @@ sub init_schema { my $schema; - my @connect_info = ($dsn, $dbuser, $dbpass, { AutoCommit => 1, sqlite_unicode => 1 }); + my @connect_info = ($dsn, $dbuser, $dbpass, { AutoCommit => 1, mysql_enable_utf8 => 1 }); if ($args{compose_connection}) { $schema = DBICTest::Schema->compose_connection(