| 1 | package CHI::Driver::MongoDB::t::CHIDriverTests; | ||||||||||||
| 2 | 1 | $CHI::Driver::MongoDB::t::CHIDriverTests::VERSION = '0.0001'; | |||||||||||
| 3 | # ABSTRACT: Wrapper for the CHI driver test suite | ||||||||||||
| 4 | |||||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 1 | ▶ | use CHI::Test; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 1 | ▶ | use base qw(CHI::t::Driver); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 0 | ▶ | sub testing_driver_class {'CHI::Driver::MongoDB'} | ||||||||||
|
Subroutine
testing_driver_class: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 11 | |||||||||||||
| 12 | # Flags indicating what each test driver supports | ||||||||||||
| 13 | 0 | ▶ | sub supports_clear {1} | ||||||||||
|
Subroutine
supports_clear: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 14 | 0 | ▶ | sub supports_expires_on_backend {1} | ||||||||||
|
Subroutine
supports_expires_on_backend: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 15 | 0 | ▶ | sub supports_get_namespaces {1} | ||||||||||
|
Subroutine
supports_get_namespaces: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 16 | |||||||||||||
| 17 | |||||||||||||
| 18 | sub new_cache_options { | ||||||||||||
| 19 | 0 | ▶ | my $self = shift; | ||||||||||
|
Subroutine
new_cache_options: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 20 | |||||||||||||
| 21 | return ( | ||||||||||||
| 22 | $self->SUPER::new_cache_options(), | ||||||||||||
| 23 | |||||||||||||
| 24 | # Any necessary CHI->new parameters for your test driver | ||||||||||||
| 25 | 0 | ▶ | connection_uri => $ENV{'MONGODB_CONNECTION_URI'} // 'mongodb://127.0.0.1:27017', | ||||||||||
|
Condition0%0/2
$ENV{"MONGODB_CONNECTION_URI"} // "mongodb://127.0.0.1:27017"
MC/DC0%0/1
$ENV{"MONGODB_CONNECTION_URI"} // "mongodb://127.0.0.1:27017"
$ENV{"MONGODB_CONNECTION_URI"}
Truth table0%0/2
A
A= $ENV{"MONGODB_CONNECTION_URI"}
| |||||||||||||
| 26 | db_name => '_CHI_TESTING_', | ||||||||||||
| 27 | ); | ||||||||||||
| 28 | } | ||||||||||||
| 29 | |||||||||||||
| 30 | |||||||||||||
| 31 | sub _drop_at_startup : Test(startup) { | ||||||||||||
| 32 | 0 | ▶ | diag "Dropping database prior to running any tests..."; | ||||||||||
|
Subroutine
_drop_at_startup: not called CC=1 SCAR=6.9
| |||||||||||||
| 33 | 0 | goto &_drop_db; | |||||||||||
| 34 | 1 | ▶ | } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 35 | |||||||||||||
| 36 | |||||||||||||
| 37 | sub _drop_at_setup : Test(setup) { | ||||||||||||
| 38 | 0 | ▶ | goto &_drop_db; | ||||||||||
|
Subroutine
_drop_at_setup: not called CC=1 SCAR=6.9
| |||||||||||||
| 39 | 1 | ▶ | } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 40 | |||||||||||||
| 41 | |||||||||||||
| 42 | sub _drop_at_shutdown : Test(shutdown) { | ||||||||||||
| 43 | 0 | ▶ | diag "Dropping database after final test..."; | ||||||||||
|
Subroutine
_drop_at_shutdown: not called CC=1 SCAR=6.9
| |||||||||||||
| 44 | 0 | goto &_drop_db; | |||||||||||
| 45 | 1 | ▶ | } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 46 | |||||||||||||
| 47 | |||||||||||||
| 48 | sub _drop_db { | ||||||||||||
| 49 | 0 | ▶ | my $self = shift; | ||||||||||
|
Subroutine
_drop_db: not called CC=1 SCAR=6.9
| |||||||||||||
| 50 | |||||||||||||
| 51 | 0 | my $cache = $self->new_cache; | |||||||||||
| 52 | 0 | $cache->mongodb->get_database( $cache->db_name )->drop; | |||||||||||
| 53 | } | ||||||||||||
| 54 | |||||||||||||
| 55 | 1 | 1; | |||||||||||
| 56 | |||||||||||||
| 57 | __END__ | ||||||||||||