X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F80unique.t;h=b38022504c49faf06501d0ca38d8bc766ac62d7f;hb=d85ef5e2867bc0360a72090aeaea4308792651e8;hp=7f78ef524c410a17247e35988fdab7ba07ccdea3;hpb=e29e2b27d08d645f8a50d7ffafef28c67688207e;p=dbsrgits%2FDBIx-Class.git diff --git a/t/80unique.t b/t/80unique.t index 7f78ef5..b380225 100644 --- a/t/80unique.t +++ b/t/80unique.t @@ -6,8 +6,6 @@ use Test::Exception; use Test::Warn; use lib qw(t/lib); use DBICTest; -use DBIC::SqlMakerTest; -use DBIC::DebugObj; my $schema = DBICTest->init_schema(); @@ -226,25 +224,14 @@ is($row->baz, 3, 'baz is correct'); # make sure the ident condition is assembled sanely { - my $artist = $schema->resultset('Artist')->next; - - my ($sql, @bind); - my $old_debugobj = $schema->storage->debugobj; - my $old_debug = $schema->storage->debug; - $schema->storage->debugobj(DBIC::DebugObj->new(\$sql, \@bind)), - $schema->storage->debug(1); - - $artist->discard_changes; - - is_same_sql_bind ( - $sql, - \@bind, - 'SELECT me.artistid, me.name, me.rank, me.charfield FROM artist me WHERE me.artistid = ?', - [qw/'1'/], - ); - - $schema->storage->debug($old_debug); - $schema->storage->debugobj($old_debugobj); + my $artist = $schema->resultset('Artist')->find(1); + + $schema->is_executed_sql_bind( sub { $artist->discard_changes }, [ + [ + 'SELECT me.artistid, me.name, me.rank, me.charfield FROM artist me WHERE me.artistid = ?', + [ { dbic_colname => "me.artistid", sqlt_datatype => "integer" } => 1 ], + ] + ], 'Expected query on discard_changes'); } {