Ejemplo n.º 1
0
            $this->assertEquals(InputFilter::safeSQL('a\\\'b\\"c\\\\d\\\\x00e\\\\nf\\\\rg\\\\x1a', $rs), 'a\\\'b\\"c\\\\d\\\\x00e\\\\nf\\\\rg\\\\x1a');
        } else {
            // verify magic quotes aren't there
            $pattern = "a'b\"c\\de\nf\rgh";
            $non_zero_pattern = "a'b\"c\\de\nf\rgh";
            $quoted_pattern = "a\\'b\\\"c\\\\de\\\nf\\\rg\\h";
            $quoted_non_zero_pattern = "a\\'b\\\"c\\\\de\\\nf\\\rg\\h";
            //            echo "\nIf this fails it means mysql_real_escape_string() is broken: ";
            //            $this->assertEquals(mysql_real_escape_string($non_zero_pattern),
            //                                $quoted_non_zero_pattern);
            //            echo "\nIf this fails it means mysql_real_escape_string() is broken: ";
            //            $this->assertEquals(mysql_real_escape_string($pattern),
            //                                $quoted_pattern);
            //            $this->assertEquals(
            //                   InputFilter::safeSQL($pattern,$rs),$quoted_pattern);
        }
        // Remove the following line when you complete this test.
        throw new PHPUnit2_Framework_IncompleteTestError();
    }
}
// Call InputFilterTest::main() if this source file is executed directly.
if (PHPUnit2_MAIN_METHOD == "InputFilterTest::main") {
    InputFilterTest::main();
}
// -- set Emacs parameters --
// Local variables:
// tab-width: 4
// c-basic-offset: 4
// c-hanging-comment-ender-p: nil
// indent-tabs-mode: nil
// End: