Skip to content

Commit

Permalink
resetting connection in setUpBeforeClass
Browse files Browse the repository at this point in the history
  • Loading branch information
Raaghu committed Mar 13, 2017
1 parent a715525 commit 8053498
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Tests/PersistUnit/ModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ protected static function getCaches(){
}

public static function setUpBeforeClass(){
// close connections if any
$reflectionProperty = new \ReflectionProperty('PhpPlatform\Persist\Connection\ConnectionFactory', 'connection');
$reflectionProperty->setAccessible(true);
$conection = $reflectionProperty->getValue(null);
if($conection != null){
$conection->close();
$reflectionProperty->setValue(null,null);
}

self::$_databaseName = "db".preg_replace('/[^0-9]/', '', microtime());

// get connection parameters
Expand Down

0 comments on commit 8053498

Please sign in to comment.