~ubuntu-branches/ubuntu/utopic/libapache-session-perl/utopic

« back to all changes in this revision

Viewing changes to t/99mysqlstore.t

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Krzyzaniak (eloy)
  • Date: 2006-06-22 16:37:15 UTC
  • mfrom: (1.2.1 upstream) (3.1.2 edgy)
  • Revision ID: james.westby@ubuntu.com-20060622163715-qict1s1id0s087vu
Tags: 1.81-1
* New upstream release
* debian/control:
 - Uploaders: added me
 - Description: changed 'this module' to 'Apache::Session'

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
eval {require DBI; require DBD::mysql;};
2
 
if ($@ || !$ENV{'APACHE_SESSION_MAINTAINER'}) {
3
 
    print "1..0\n";
4
 
    exit;
5
 
}
6
 
 
7
 
use Apache::Session::Store::MySQL;
8
 
use DBI;
9
 
 
10
 
use strict;
11
 
 
12
 
print "1..1\n";
13
 
 
14
 
my $foo = new Apache::Session::Store::MySQL;
15
 
 
16
 
if (ref $foo) {
17
 
    print "ok 1\n";
18
 
}
19
 
else {
20
 
    print "not ok 1\n";
21
 
}
22
 
 
 
1
use Test::More;
 
2
use Test::Deep;
 
3
use Test::Exception;
 
4
use File::Temp qw[tempdir];
 
5
use Cwd qw[getcwd];
 
6
 
 
7
plan skip_all => "Optional modules (DBD::mysql, DBI) not installed"
 
8
  unless eval {
 
9
               require DBI;
 
10
               require DBD::mysql;
 
11
              };
 
12
plan skip_all => "Not running RDBM tests without APACHE_SESSION_MAINTAINER=1"
 
13
  unless $ENV{APACHE_SESSION_MAINTAINER};
 
14
 
 
15
my $origdir = getcwd;
 
16
my $tempdir = tempdir( DIR => '.', CLEANUP => 1 );
 
17
chdir( $tempdir );
 
18
 
 
19
plan tests => 2;
 
20
 
 
21
my $package = 'Apache::Session::Store::MySQL';
 
22
use_ok $package;
 
23
 
 
24
my $foo = $package->new;
 
25
 
 
26
isa_ok $foo, $package;
 
27
 
 
28
chdir( $origdir );