Permalink
Browse files

MDL-34130 prevent some warning in PHPStorm

  • Loading branch information...
1 parent d0812ba commit 19ba134d3bbb6e36c51da63f6292c6ddf882a519 @skodak skodak committed Jul 1, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/dml/tests/dml_test.php
@@ -308,20 +308,21 @@ public function test_fix_table_names() {
function test_fix_sql_params() {
$DB = $this->tdb;
+ $prefix = $DB->get_prefix();
$table = $this->get_test_table();
$tablename = $table->getName();
// Correct table placeholder substitution
$sql = "SELECT * FROM {{$tablename}}";
$sqlarray = $DB->fix_sql_params($sql);
- $this->assertEquals("SELECT * FROM {$DB->get_prefix()}".$tablename, $sqlarray[0]);
+ $this->assertEquals("SELECT * FROM {$prefix}".$tablename, $sqlarray[0]);
// Conversions of all param types
$sql = array();
- $sql[SQL_PARAMS_NAMED] = "SELECT * FROM {$DB->get_prefix()}testtable WHERE name = :param1, course = :param2";
- $sql[SQL_PARAMS_QM] = "SELECT * FROM {$DB->get_prefix()}testtable WHERE name = ?, course = ?";
- $sql[SQL_PARAMS_DOLLAR] = "SELECT * FROM {$DB->get_prefix()}testtable WHERE name = \$1, course = \$2";
+ $sql[SQL_PARAMS_NAMED] = "SELECT * FROM {$prefix}testtable WHERE name = :param1, course = :param2";
+ $sql[SQL_PARAMS_QM] = "SELECT * FROM {$prefix}testtable WHERE name = ?, course = ?";
+ $sql[SQL_PARAMS_DOLLAR] = "SELECT * FROM {$prefix}testtable WHERE name = \$1, course = \$2";
$params = array();
$params[SQL_PARAMS_NAMED] = array('param1'=>'first record', 'param2'=>1);

0 comments on commit 19ba134

Please sign in to comment.