X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fbindtype_columns.t;h=5b83255b64c6ba6bcf556721f7fa953886e61fd9;hb=1d7e89b8623b1ae271aac80651d16dc7c655b15a;hp=2d9bffe20c189b6678d802aac069a0b3b7227fcf;hpb=9fdf90df36ee55e3b16dacd82ad35b12c9d4e15a;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/bindtype_columns.t b/t/bindtype_columns.t index 2d9bffe..5b83255 100644 --- a/t/bindtype_columns.t +++ b/t/bindtype_columns.t @@ -7,18 +7,14 @@ use DBICTest; my ($dsn, $dbuser, $dbpass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/}; -$dsn = 'dbi:Pg:dbname=postgres;host=localhost' unless $dsn; -$dbuser = 'postgres' unless $dbuser; -$dbpass = 'postgres' unless $dbpass; - plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test' unless ($dsn && $dbuser); plan tests => 3; -DBICTest::Schema->compose_connection('PGTest' => $dsn, $dbuser, $dbpass); +my $schema = DBICTest::Schema->connection($dsn, $dbuser, $dbpass, { AutoCommit => 1 }); -my $dbh = PGTest->schema->storage->dbh; +my $dbh = $schema->storage->dbh; $dbh->do(qq[ @@ -31,30 +27,30 @@ $dbh->do(qq[ ],{ RaiseError => 1, PrintError => 1 }); -PGTest::Artist->load_components(qw/ +$schema->class('Artist')->load_components(qw/ PK::Auto Core /); -PGTest::Artist->add_columns( +$schema->class('Artist')->add_columns( "media", { data_type => "bytea", - is_nullable => 0, + is_nullable => 0, }, ); # test primary key handling my $big_long_string = 'abcd' x 250000; -my $new = PGTest::Artist->create({ media => $big_long_string }); +my $new = $schema->resultset('Artist')->create({ media => $big_long_string }); ok($new->artistid, "Created a blob row"); is($new->media, $big_long_string, "Set the blob correctly."); -my $rs = PGTest::Artist->find({artistid=>$new->artistid}); +my $rs = $schema->resultset('Artist')->find({artistid=>$new->artistid}); is($rs->get_column('media'), $big_long_string, "Created the blob correctly.");