ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 94 of file ilDatabaseBaseTest.php.

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

Referenced by setUp().

95  {
96  require_once('./Services/Init/classes/class.ilIniFile.php');
97  require_once('./Services/Init/classes/class.ilErrorHandling.php');
98  $ilClientIniFile = new ilIniFile($this->getIniFile());
99  $ilClientIniFile->read();
100  $this->type = $ilClientIniFile->readVariable("db", "type");
101  $ilDBInterface->initFromIniFile($ilClientIniFile);
102  $return = $ilDBInterface->connect();
103 
104  return $return;
105  }
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 75 of file ilDatabaseBaseTest.php.

References ilDBConstants\TYPE_PDO_MYSQL_INNODB.

Referenced by setUp().

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

◆ getIniFile()

ilDatabaseBaseTest::getIniFile ( )
protected
Returns
string

Definition at line 84 of file ilDatabaseBaseTest.php.

References $ini_file.

Referenced by connect().

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

◆ setUp()

ilDatabaseBaseTest::setUp ( )
protected

Definition at line 54 of file ilDatabaseBaseTest.php.

References connect(), and getDBInstance().

55  {
56  $this->error_reporting_backup = error_reporting();
57 
58  PHPUnit_Framework_Error_Notice::$enabled = false;
59  PHPUnit_Framework_Error_Deprecated::$enabled = false;
60 
61  require_once('./libs/composer/vendor/autoload.php');
62  if (!defined('DEVMODE')) {
63  define('DEVMODE', true);
64  }
65  require_once('./Services/Database/classes/class.ilDBWrapperFactory.php');
66  $this->db = $this->getDBInstance();
67  $this->connect($this->db);
68  }
connect(ilDBInterface $ilDBInterface)
+ Here is the call graph for this function:

◆ tearDown()

ilDatabaseBaseTest::tearDown ( )
protected

Definition at line 108 of file ilDatabaseBaseTest.php.

References $table, and ilDBConstants\MODULE_MANAGER.

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

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: