use Test::More;
use IO::File;
-use SQL::Abstract::Test import => ['is_same_sql_bind'];
+
+use lib qw(t/lib);
+use DBIC::SqlMakerTest;
BEGIN {
eval "use DBD::SQLite";
: ( 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(
{ 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;
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'
);
{ 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(
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'
);