changelog and bump
[dbsrgits/DBIx-Class-Fixtures.git] / t / 19-populate-unicode.t
CommitLineData
593b3c23 1#!perl
2
3use DBIx::Class::Fixtures;
4use Test::More no_plan;
5use lib qw(t/lib);
6use DBICTest;
7use Path::Class;
8use Data::Dumper;
9use IO::All;
10use utf8;
11
12# set up and populate schema
13ok( my $schema = DBICTest->init_schema(), 'got schema' );
14my $config_dir = io->catfile(qw't var configs')->name;
15
16# do dump
17ok(
18 my $fixtures = DBIx::Class::Fixtures->new(
19 {
20 config_dir => $config_dir,
21 debug => 0
22 }
23 ),
24 'object created with correct config dir'
25);
26
27DBICTest->clear_schema($schema);
28DBICTest->populate_schema($schema);
29
30ok(
31 $fixtures->dump(
32 {
33 schema => $schema,
34 directory => io->catfile(qw't var fixtures')->name,
35 config => "unicode.json",
36 }
37 ),
38 "unicode dump executed okay"
39);
40
41$fixtures->populate(
42 {
43 connection_details => [ 'dbi:SQLite:' . io->catfile(qw[ t var DBIxClass.db ])->name, '', '' ],
44 directory => io->catfile(qw't var fixtures')->name,
45 schema => $schema,
46 no_deploy => 1,
47 use_find_or_create => 1,
48 }
49);
50
51my $cd = $schema->resultset('CD')->find( { cdid => 5 });
52
53is($cd->title, "Unicode Chars ™ © • † ∑ α β « » → …", "Unicode chars found");