ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilDatabaseReservedWordsTest.php
Go to the documentation of this file.
1 <?php
2 
9 
10  protected function setUp() {
11  PHPUnit_Framework_Error_Notice::$enabled = false;
12  PHPUnit_Framework_Error_Deprecated::$enabled = false;
13  parent::setUp();
14  require_once('./Services/Database/classes/class.ilDBConstants.php');
15  global $ilDB, $DIC;
16  require_once('./Services/Database/classes/PDO/class.ilDBPdoMySQLInnoDB.php');
17  $ilDB = new ilDBPdoMySQLInnoDB();
18  $DIC['ilDB'] = $ilDB;
19  }
20 
21 
27  public function testReservedMDB2($word, $is_reserved) {
28  require_once('./Services/Database/classes/MDB2/class.ilDBMySQL.php');
29  $this->assertEquals($is_reserved, ilDBMySQL::isReservedWord($word));
30  }
31 
32 
38  public function testReservedPDO($word, $is_reserved) {
39  require_once('./Services/Database/classes/PDO/class.ilDBPdoMySQLInnoDB.php');
40  $this->assertEquals($is_reserved, ilDBPdoMySQLInnoDB::isReservedWord($word));
41  }
42 
43 
47  public function reservedData() {
48  return [
49  [ 'order', true ],
50  [ 'myfield', false ],
51  [ 'number', true ],
52  [ 'null', true ],
53  [ 'sensitive', true ],
54  [ 'usage', true ],
55  [ 'analyze', true ],
56  ];
57  }
58 }
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.
global $DIC