X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F19quotes_newstyle.t;h=3e7595aab975a94a1d4016418843e281d9200473;hb=f549392f2e93fec75fa5190363d0a465dd5a8f55;hp=5b8fcc794b8915020ad24ede0a9010dc16b8d759;hpb=949172b0fa30a832d268c3f55f97247a10742314;p=dbsrgits%2FDBIx-Class.git diff --git a/t/19quotes_newstyle.t b/t/19quotes_newstyle.t index 5b8fcc7..3e7595a 100644 --- a/t/19quotes_newstyle.t +++ b/t/19quotes_newstyle.t @@ -3,6 +3,8 @@ use warnings; use Test::More; use IO::File; + +use lib qw(t/lib); use DBIC::SqlMakerTest; BEGIN { @@ -12,14 +14,12 @@ BEGIN { : ( tests => 7 ); } -use lib qw(t/lib); - use_ok('DBICTest'); -use_ok('DBICTest::DBICDebugObj'); +use_ok('DBIC::DebugObj'); my $schema = DBICTest->init_schema(); -diag('Testing against ' . join(' ', map { $schema->storage->dbh->get_info($_) } qw/17 18/)); +#diag('Testing against ' . join(' ', map { $schema->storage->dbh->get_info($_) } qw/17 18/)); my $dsn = $schema->storage->_dbi_connect_info->[0]; $schema->connection( @@ -30,8 +30,8 @@ $schema->connection( { quote_char => '`', name_sep => '.' }, ); -my ($sql, @bind) = (''); -$schema->storage->debugobj(DBICTest::DBICDebugObj->new(\$sql, \@bind)), +my ($sql, @bind); +$schema->storage->debugobj(DBIC::DebugObj->new(\$sql, \@bind)), $schema->storage->debug(1); my $rs; @@ -42,7 +42,7 @@ $rs = $schema->resultset('CD')->search( eval { $rs->count }; is_same_sql_bind( $sql, \@bind, - "SELECT COUNT( * ) FROM `cd` `me` JOIN `artist` `artist` ON ( `artist`.`artistid` = `me`.`artist` ) WHERE ( `artist`.`name` = ? AND `me`.`year` = ? )", ["'Caterwauler McCrae'", "'2001'"], + "SELECT COUNT( * ) FROM cd `me` JOIN `artist` `artist` ON ( `artist`.`artistid` = `me`.`artist` ) WHERE ( `artist`.`name` = ? AND `me`.`year` = ? )", ["'Caterwauler McCrae'", "'2001'"], 'got correct SQL for count query with quoting' ); @@ -64,7 +64,7 @@ $schema->connection( { AutoCommit => 1, quote_char => [qw/[ ]/], name_sep => '.' } ); -$schema->storage->debugobj(DBICTest::DBICDebugObj->new(\$sql, \@bind)), +$schema->storage->debugobj(DBIC::DebugObj->new(\$sql, \@bind)), $schema->storage->debug(1); $rs = $schema->resultset('CD')->search( @@ -73,7 +73,7 @@ $rs = $schema->resultset('CD')->search( eval { $rs->count }; is_same_sql_bind( $sql, \@bind, - "SELECT COUNT( * ) FROM [cd] [me] JOIN [artist] [artist] ON ( [artist].[artistid] = [me].[artist] ) WHERE ( [artist].[name] = ? AND [me].[year] = ? )", ["'Caterwauler McCrae'", "'2001'"], + "SELECT COUNT( * ) FROM cd [me] JOIN [artist] [artist] ON ( [artist].[artistid] = [me].[artist] ) WHERE ( [artist].[name] = ? AND [me].[year] = ? )", ["'Caterwauler McCrae'", "'2001'"], 'got correct SQL for count query with bracket quoting' );