ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilDatabaseBaseTest Class Reference

TestCase for the ilDatabaseCommonTest. More...

+ Inheritance diagram for ilDatabaseBaseTest:
+ Collaboration diagram for ilDatabaseBaseTest:

Protected Member Functions

 setUp ()
 
 getDBInstance ()
 
 getIniFile ()
 
 connect (ilDBInterface $ilDBInterface)
 
 tearDown ()
 

Protected Attributes

 $db
 
 $ini_file = '/var/www/ilias/data/trunk/client.ini.php'
 
 $error_reporting_backup
 

Detailed Description

TestCase for the ilDatabaseCommonTest.

needsInstalledILIAS

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0.0

Definition at line 34 of file ilDatabaseBaseTest.php.

Member Function Documentation

◆ connect()

ilDatabaseBaseTest::connect ( ilDBInterface  $ilDBInterface)
protected
Parameters
\ilDBInterface$ilDBInterface
Returns
bool

Definition at line 95 of file ilDatabaseBaseTest.php.

References ilDBInterface\connect(), getIniFile(), and ilDBInterface\initFromIniFile().

Referenced by setUp().

96  {
97  require_once('./Services/Init/classes/class.ilIniFile.php');
98  require_once('./Services/Init/classes/class.ilErrorHandling.php');
99  $ilClientIniFile = new ilIniFile($this->getIniFile());
100  $ilClientIniFile->read();
101  $this->type = $ilClientIniFile->readVariable("db", "type");
102  $ilDBInterface->initFromIniFile($ilClientIniFile);
103  $return = $ilDBInterface->connect();
104 
105  return $return;
106  }
initFromIniFile($tmpClientIniFile=null)
connect($return_false_on_error=false)
INIFile Parser.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDBInstance()

ilDatabaseBaseTest::getDBInstance ( )
protected
Returns
Exceptions

Definition at line 76 of file ilDatabaseBaseTest.php.

References ilDBConstants\TYPE_PDO_MYSQL_INNODB.

Referenced by setUp().

77  {
78  return ilDBWrapperFactory::getWrapper(ilDBConstants::TYPE_PDO_MYSQL_INNODB);
79  }
+ Here is the caller graph for this function:

◆ getIniFile()

ilDatabaseBaseTest::getIniFile ( )
protected
Returns
string

Definition at line 85 of file ilDatabaseBaseTest.php.

References $ini_file.

Referenced by connect().

86  {
87  return $this->ini_file;
88  }
+ Here is the caller graph for this function:

◆ setUp()

ilDatabaseBaseTest::setUp ( )
protected

Definition at line 54 of file ilDatabaseBaseTest.php.

References connect(), defined, and getDBInstance().

55  {
56  $this->error_reporting_backup = error_reporting();
57  error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_WARNING & ~E_STRICT); // Due to PEAR Lib MDB2
58 
59  PHPUnit_Framework_Error_Notice::$enabled = false;
60  PHPUnit_Framework_Error_Deprecated::$enabled = false;
61 
62  require_once('./libs/composer/vendor/autoload.php');
63  if (!defined('DEVMODE')) {
64  define('DEVMODE', true);
65  }
66  require_once('./Services/Database/classes/class.ilDBWrapperFactory.php');
67  $this->db = $this->getDBInstance();
68  $this->connect($this->db);
69  }
connect(ilDBInterface $ilDBInterface)
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
+ Here is the call graph for this function:

◆ tearDown()

ilDatabaseBaseTest::tearDown ( )
protected

Definition at line 109 of file ilDatabaseBaseTest.php.

References $table, array, and ilDBConstants\MODULE_MANAGER.

110  {
111  error_reporting($this->error_reporting_backup);
112  }

Field Documentation

◆ $db

ilDatabaseBaseTest::$db
protected

Definition at line 40 of file ilDatabaseBaseTest.php.

◆ $error_reporting_backup

ilDatabaseBaseTest::$error_reporting_backup
protected

Definition at line 51 of file ilDatabaseBaseTest.php.

◆ $ini_file

ilDatabaseBaseTest::$ini_file = '/var/www/ilias/data/trunk/client.ini.php'
protected

Definition at line 47 of file ilDatabaseBaseTest.php.

Referenced by getIniFile().


The documentation for this class was generated from the following file: