Correctly propagate forced left joins through arrayrefs and hashrefs
[dbsrgits/DBIx-Class.git] / t / 32connect_hash.t
CommitLineData
516ff3ba 1use strict;
2use warnings;
3
4use Test::More;
5use lib qw(t/lib);
6use DBICTest;
7
8plan tests => 1;
9
10# Set up the "usual" sqlite for DBICTest
11my $normal_schema = DBICTest->init_schema( sqlite_use_file => 1 );
12
13my @connect_info = @{ $normal_schema->storage->_dbi_connect_info };
14
15my %connect_info = (
16 dsn => $connect_info[0],
17 user => $connect_info[1],
18 password => $connect_info[2],
19 %{ $connect_info[3] },
20 AutoCommit => 1,
21 cursor_class => 'DBIx::Class::Storage::DBI::Cursor'
22);
23
24# Make sure we have no active connection
25$normal_schema->storage->disconnect;
26
27# Make a new clone with a new connection, using a hash reference
28my $hash_schema = $normal_schema->connect(\%connect_info);
29
30# Stolen from 60core.t - this just verifies things seem to work at all
31my @art = $hash_schema->resultset("Artist")->search({ }, { order_by => 'name DESC'});
32cmp_ok(@art, '==', 3, "Three artists returned");