« blib/lib/DB/Introspector/CommonRDB/Introspector.pm
↑ Summary
blib/lib/DB/Introspector/Base/Column.pm »
| 1 | package DB::IntrospectorBaseTest; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 1 | ▶ | use base qw( Test::Unit::TestCase ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 1 | ▶ | use DBI; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||
| 11 | 0 | my $class = shift; | |||||||||||||||||||
| 12 | 0 | ▶ | $class = ref($class) || $class; | ||||||||||||||||||
|
Condition0%0/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table0%0/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||
| 13 | 0 | my $self = $class->SUPER::new(@_); | |||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 0 | ▶ | my $dbh = $_[1] || die("$class->new(name,dbh) requires a dbh"); | ||||||||||||||||||
|
Condition0%0/2
$_[1] || die("$class->new(name,dbh) requires a dbh")
MC/DC0%0/1
$_[1] || die("$class->new(name,dbh) requires a dbh")
$_[1]
Truth table0%0/2
A
A= $_[1]
| |||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 0 | $self->{_dbh} = $dbh; | |||||||||||||||||||
| 18 | 0 | return $self; | |||||||||||||||||||
| 19 | } | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 0 | ▶ | sub _dbh { | ||||||||||||||||||
|
Subroutine
_dbh: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 23 | 0 | my $self = shift; | |||||||||||||||||||
| 24 | 0 | return $self->{_dbh}; | |||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 0 | ▶ | sub _introspector { | ||||||||||||||||||
|
Subroutine
_introspector: not called CC=2 SCAR=17.9
| |||||||||||||||||||||
| 28 | 0 | my $self = shift; | |||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 0 | ▶ | $self->{_introspector} = shift if(@_); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 0 | return $self->{_introspector}; | |||||||||||||||||||
| 33 | } | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 0 | ▶ | sub set_up { | ||||||||||||||||||
|
Subroutine
set_up: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 36 | 0 | my $self = shift; | |||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 0 | $self->_introspector( DB::Introspector->get_instance($self->_dbh) ); | |||||||||||||||||||
| 39 | } | ||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | 1 | ▶ | use Devel::Symdump; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 42 | 0 | ▶ | sub suite { | ||||||||||||||||||
|
Subroutine
suite: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 43 | 0 | my $self = shift; | |||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 0 | my $suite = empty_new Test::Unit::TestSuite; | |||||||||||||||||||
| 46 | 0 | ▶ | my $symdump = new Devel::Symdump(ref($self) || $self); | ||||||||||||||||||
|
Condition0%0/3
ref $self || $self
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table0%0/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||
| 47 | 0 | foreach my $method ( map{ | |||||||||||||||||||
| 48 | 0 | $_ =~ s@.*::test@test@g; $_; | |||||||||||||||||||
| 49 | 0 | } grep { /^.*::test.*/ } $symdump->functions ) { | |||||||||||||||||||
| 50 | 0 | $suite->add_test($self->new($method, $self->_dbh)); | |||||||||||||||||||
| 51 | } | ||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | 0 | return $suite; | |||||||||||||||||||
| 54 | } | ||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | 1 | 1; | |||||||||||||||||||