You are here

function CoderUpgrade6xTest::testUpgrade6xDatabase in Coder 6.2

Same name and namespace in other branches
  1. 6 tests/coder_6x.test \CoderUpgrade6xTest::testUpgrade6xDatabase()

File

tests/coder_6x.test, line 99

Class

CoderUpgrade6xTest

Code

function testUpgrade6xDatabase() {
  $this
    ->assertCoderFail("  function mymodule_install() {\n  \$type = \$GLOBALS['db_type'];\n}");
  $this
    ->assertCoderFail("  function mymodule_uninstall() {\n  \$type = \$GLOBALS['db_type'];\n}");
  $this
    ->assertCoderFail("  function mymodule_update_1() {\n  \$type = \$GLOBALS['db_type'];\n}");
  $this
    ->assertCoderFail('  db_next_id();');
  $this
    ->assertCoderFail('  db_num_rows();');
  $this
    ->assertCoderFail('  db_result($result, $row);');
  $this
    ->assertCoderPass('  db_result($result);');
  $this
    ->assertCoderPass('  $number = db_result(db_query("SELECT COUNT(*) FROM {flood} WHERE event = \'%s\' AND hostname = \'%s\' AND timestamp > %d", $name, ip_address(), time() - 3600));');
  $this
    ->assertCoderFail('  $sql = "CREATE TABLE foo ()";');
  $this
    ->assertCoderFail('  $sql = "DROP TABLE foo";');
  $this
    ->assertCoderFail('  $sql = "ALTER TABLE foo";');
}