ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 91 of file ilDatabaseBaseTest.php.

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

Referenced by setUp().

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

References ilDBConstants\TYPE_PDO_MYSQL_INNODB.

Referenced by setUp().

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

◆ getIniFile()

ilDatabaseBaseTest::getIniFile ( )
protected
Returns
string

Definition at line 82 of file ilDatabaseBaseTest.php.

References $ini_file.

Referenced by connect().

82  {
83  return $this->ini_file;
84  }
+ Here is the caller graph for this function:

◆ setUp()

ilDatabaseBaseTest::setUp ( )
protected

Definition at line 53 of file ilDatabaseBaseTest.php.

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

53  {
54  $this->error_reporting_backup = error_reporting();
55  error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_WARNING & ~E_STRICT); // Due to PEAR Lib MDB2
56 
57  PHPUnit_Framework_Error_Notice::$enabled = false;
58  PHPUnit_Framework_Error_Deprecated::$enabled = false;
59 
60  require_once('./libs/composer/vendor/autoload.php');
61  if (!defined('DEVMODE')) {
62  define('DEVMODE', true);
63  }
64  require_once('./Services/Database/classes/class.ilDBWrapperFactory.php');
65  $this->db = $this->getDBInstance();
66  $this->connect($this->db);
67  }
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 104 of file ilDatabaseBaseTest.php.

References array, and ilDBConstants\MODULE_MANAGER.

104  {
105  error_reporting($this->error_reporting_backup);
106  }

Field Documentation

◆ $db

ilDatabaseBaseTest::$db
protected

Definition at line 39 of file ilDatabaseBaseTest.php.

◆ $error_reporting_backup

ilDatabaseBaseTest::$error_reporting_backup
protected

Definition at line 50 of file ilDatabaseBaseTest.php.

◆ $ini_file

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

Definition at line 46 of file ilDatabaseBaseTest.php.

Referenced by getIniFile().


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