public final function getConnection() { if ($this->conn === null) { if (self::$pdo == null) { self::$pdo = new PDO('mysql:dbname=' . BB_DB_NAME . ';host=127.0.0.1', BB_DB_USER, BB_DB_PASSWORD); } $this->conn = $this->createDefaultDBConnection(self::$pdo, BB_DB_NAME); } return $this->conn; }
protected function tearDown() { parent::tearDown(); $refl = new ReflectionObject($this); foreach ($refl->getProperties() as $prop) { if (!$prop->isStatic() && 0 !== strpos($prop->getDeclaringClass()->getName(), 'PHPUnit_')) { $prop->setAccessible(true); $prop->setValue($this, null); } } }