6 use File::Temp qw(tempdir);
8 use Test::Requires qw(DBI DBD::SQLite MIME::Base64 Storable);
13 use Plack::Session::State::Cookie;
14 use Plack::Session::Store::DBI;
16 use t::lib::TestSession;
18 my $tmp = tempdir(CLEANUP => 1);
19 my $file = File::Spec->catfile($tmp, "006_basic_w_dbi_store.db");
20 my $dbh = DBI->connect( "dbi:SQLite:$file", undef, undef, {RaiseError => 1, AutoCommit => 1} );
22 CREATE TABLE sessions (
23 id CHAR(72) PRIMARY KEY,
28 t::lib::TestSession::run_all_tests(
29 store => Plack::Session::Store::DBI->new( dbh => $dbh ),
30 state => Plack::Session::State->new,
32 open my $in, '<', \do { my $d };
34 'psgi.version' => [ 1, 0 ],
36 'psgi.errors' => *STDERR,
37 'psgi.url_scheme' => 'http',
39 REQUEST_METHOD => 'GET',
40 QUERY_STRING => join "&" => map { $_ . "=" . $_[0]->{ $_ } } keys %{$_[0] || +{}},
45 t::lib::TestSession::run_all_tests(
46 store => Plack::Session::Store::DBI->new( get_dbh => sub { $dbh } ),
47 state => Plack::Session::State->new,
49 open my $in, '<', \do { my $d };
51 'psgi.version' => [ 1, 0 ],
53 'psgi.errors' => *STDERR,
54 'psgi.url_scheme' => 'http',
56 REQUEST_METHOD => 'GET',
57 QUERY_STRING => join "&" => map { $_ . "=" . $_[0]->{ $_ } } keys %{$_[0] || +{}},