| Server IP : 162.144.4.212 / Your IP : 216.73.216.50 Web Server : Apache System : Linux gator2125.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : cozeellc ( 2980) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /opt/PUC/t/Module/SQLiteStore/ |
Upload File : |
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Test::Exception;
use DBI;
use PUC::Module::WebApp::SQLiteStore;
## no critic (ProhibitConstantPragma)
use constant CLASS => 'PUC::Module::WebApp::SQLiteStore';
## use critic
my $store;
lives_ok {
$store = CLASS->new( dbfile => ':memory:' );
}
'New memory store';
subtest 'Create the database table' => sub {
$store->create_local_store;
my $dbh;
note 'Connecting to ' . $store->dsn;
lives_ok {
$dbh = DBI->connect_cached( $store->dsn );
}
'Connection to in-memory database';
my $r = $dbh->selectrow_hashref( <<'SQL', { RaiseError => 1 } );
PRAGMA main.table_info('webapps')
SQL
ok exists( $r->{name} ),
'First column defined';
ok $r->{pk},
'First column is part of primary key';
ok $r->{notnull},
'First column is NOT NULL';
};
done_testing;