diff --git a/Unit_testing/Schema.php b/Unit_testing/Schema.php index e75c7f0..59c3005 100644 --- a/Unit_testing/Schema.php +++ b/Unit_testing/Schema.php @@ -20,6 +20,16 @@ /** + * Connection details: Oracle service name, username, password. We only need to instantiate these once for the entire test suite. + * + * @access private + */ + static private $serviceID = null; + static private $username = null; + static private $password = null; + + + /** * List of possible mark adjustments for errors (negative) or bonuses (positive). * * @access protected @@ -220,9 +230,9 @@ { if ( self::$pdo == null ) { - self::$pdo = new PDO( "oci:dbname=isorcl-400", "stani797", "b1ggles" ); + self::$pdo = new PDO( "oci:dbname=" . self::$serviceID, self::$username, self::$password ); } - $this->conn = $this->createDefaultDBConnection( self::$pdo, "stani797" ); + $this->conn = $this->createDefaultDBConnection( self::$pdo, self::$username ); } return $this->conn; @@ -230,6 +240,78 @@ /** + * Return the Oracle service ID. + * + * @access protected + * @return string + */ + protected function getServiceID() + { + return self::$serviceID; + } + + + /** + * Return the Oracle username. + * + * @access protected + * @return string + */ + protected function getUsername() + { + return self::$username; + } + + + /** + * Return the user's password. + * + * @access protected + * @return string + */ + protected function getPassword() + { + return self::$password; + } + + + /** + * Set the Oracle service ID. + * + * @access protected + * @return void + */ + public function setServiceID( $newServiceID ) + { + self::$serviceID = $newServiceID; + } + + + /** + * Set the Oracle username. + * + * @access protected + * @return void + */ + public function setUsername( $newUsername ) + { + self::$username = $newUsername; + } + + + /** + * Set the user's password. + * + * @access protected + * @return void + */ + public function setPassword( $newPassword ) + { + self::$password = $newPassword; + } + + + /** * Return the fixture setup operation. * * We can't use the standard fixture setup operation with Oracle, because TRUNCATE doesn't work on tables that are referenced by foreign keys, even if the table is empty! We use the DELETE_ALL action operation instead.