// unicode chars
[
- self::createUnicodeString( '`\u0001a\uFFFFb`' ),
- self::createUnicodeString( '\u0001a\uFFFFb' )
+ "`\u{0001}a\u{FFFF}b`",
+ "\u{0001}a\u{FFFF}b"
],
[
- self::createUnicodeString( '`\u0001\uFFFF`' ),
- self::createUnicodeString( '\u0001\u0000\uFFFF\u0000' )
+ "`\u{0001}\u{FFFF}`",
+ "\u{0001}\u{0000}\u{FFFF}\u{0000}"
],
[ '`☃`', '☃' ],
[ '`メインページ`', 'メインページ' ],
];
}
- private static function createUnicodeString( $str ) {
- return json_decode( '"' . $str . '"' );
- }
-
private function getMockForViews() {
$db = $this->getMockBuilder( DatabaseMysqli::class )
->disableOriginalConstructor()
- ->setMethods( [ 'fetchRow', 'query' ] )
+ ->setMethods( [ 'fetchRow', 'query', 'getDBname' ] )
->getMock();
$db->method( 'query' )
(object)[ 'Tables_in_' => 'view2' ],
(object)[ 'Tables_in_' => 'myview' ]
] ) );
+ $db->method( 'getDBname' )->willReturn( '' );
return $db;
}
public function testIndexAliases() {
$db = $this->getMockBuilder( DatabaseMysqli::class )
->disableOriginalConstructor()
- ->setMethods( [ 'mysqlRealEscapeString' ] )
+ ->setMethods( [ 'mysqlRealEscapeString', 'dbSchema', 'tablePrefix' ] )
->getMock();
$db->method( 'mysqlRealEscapeString' )->willReturnCallback(
function ( $s ) {
public function testTableAliases() {
$db = $this->getMockBuilder( DatabaseMysqli::class )
->disableOriginalConstructor()
- ->setMethods( [ 'mysqlRealEscapeString' ] )
+ ->setMethods( [ 'mysqlRealEscapeString', 'dbSchema', 'tablePrefix' ] )
->getMock();
$db->method( 'mysqlRealEscapeString' )->willReturnCallback(
function ( $s ) {