ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilDatabaseReservedWordsTest.php
Go to the documentation of this file.
1 <?php
2 
9 {
10  protected function setUp()
11  {
12  PHPUnit_Framework_Error_Notice::$enabled = false;
13  PHPUnit_Framework_Error_Deprecated::$enabled = false;
14  parent::setUp();
15  require_once('./Services/Database/classes/class.ilDBConstants.php');
16  global $ilDB, $DIC;
17  require_once('./Services/Database/classes/PDO/class.ilDBPdoMySQLInnoDB.php');
18  $ilDB = new ilDBPdoMySQLInnoDB();
19  $DIC['ilDB'] = $ilDB;
20  }
21 
22 
28  public function testReservedMDB2($word, $is_reserved)
29  {
30  require_once('./Services/Database/classes/MDB2/class.ilDBMySQL.php');
31  $this->assertEquals($is_reserved, ilDBMySQL::isReservedWord($word));
32  }
33 
34 
40  public function testReservedPDO($word, $is_reserved)
41  {
42  require_once('./Services/Database/classes/PDO/class.ilDBPdoMySQLInnoDB.php');
43  $this->assertEquals($is_reserved, ilDBPdoMySQLInnoDB::isReservedWord($word));
44  }
45 
46 
50  public function reservedData()
51  {
52  return [
53  [ 'order', true ],
54  [ 'myfield', false ],
55  [ 'number', true ],
56  [ 'null', true ],
57  [ 'sensitive', true ],
58  [ 'usage', true ],
59  [ 'analyze', true ],
60  ];
61  }
62 }
global $DIC
Definition: saml.php:7
Class ilDatabaseReservedWordsTest.
static isReservedWord($a_word)
Checks whether a word is a reserved word in one of the supported databases.
testReservedPDO($word, $is_reserved)
reservedData
static isReservedWord($a_word)
testReservedMDB2($word, $is_reserved)
reservedData
global $ilDB
Class ilDBPdoMySQLInnoDB.