Merge #15960 - Windows fixes for testsuite and test fixes

Pull-request: #15960

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2020-02-15 11:19:23 +01:00
commit a4fcf79db0
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889
5 changed files with 89 additions and 92 deletions

View File

@ -794,7 +794,7 @@ class DatabaseInterface
$each_tables[$table_name]['TABLE_COMMENT']
=& $each_tables[$table_name]['Comment'];
if (strtoupper($each_tables[$table_name]['Comment']) === 'VIEW'
if (strtoupper($each_tables[$table_name]['Comment'] ?? '') === 'VIEW'
&& $each_tables[$table_name]['Engine'] == null
) {
$each_tables[$table_name]['TABLE_TYPE'] = 'VIEW';
@ -957,7 +957,7 @@ class DatabaseInterface
$databases = $this->fetchResult($sql, 'SCHEMA_NAME', null, $link);
$mysql_error = $this->getError($link);
if (! count($databases) && $GLOBALS['errno']) {
if (! count($databases) && isset($GLOBALS['errno'])) {
Util::mysqlDie($mysql_error, $sql);
}

View File

@ -703,18 +703,17 @@ class CoreTest extends PmaTestCase
$testUri_html = htmlspecialchars($testUri);
$testUri_js = Sanitize::escapeJsString($testUri);
$header = "<html>\n<head>\n <title>- - -</title>
<meta http-equiv=\"expires\" content=\"0\">"
$header = "<html>\n<head>\n <title>- - -</title>"
. "\n <meta http-equiv=\"expires\" content=\"0\">"
. "\n <meta http-equiv=\"Pragma\" content=\"no-cache\">"
. "\n <meta http-equiv=\"Cache-Control\" content=\"no-cache\">"
. "\n <meta http-equiv=\"Refresh\" content=\"0;url=" . $testUri_html . "\">"
. "\n <script type=\"text/javascript\">\n //<![CDATA[
setTimeout(function() { window.location = decodeURI('" . $testUri_js . "'); }, 2000);
//]]>\n </script>\n</head>
<body>\n<script type=\"text/javascript\">\n //<![CDATA[
document.write('<p><a href=\"" . $testUri_html . "\">" . __('Go') . "</a></p>');
//]]>\n</script>\n</body>\n</html>
";
. "\n <script type=\"text/javascript\">\n //<![CDATA["
. "\n setTimeout(function() { window.location = decodeURI('" . $testUri_js . "'); }, 2000);"
. "\n //]]>\n </script>\n</head>"
. "\n<body>\n<script type=\"text/javascript\">\n //<![CDATA["
. "\n document.write('<p><a href=\"" . $testUri_html . "\">" . __('Go') . "</a></p>');"
. "\n //]]>\n</script>\n</body>\n</html>\n";
$this->expectOutputString($header);

View File

@ -599,8 +599,7 @@ class QbeTest extends PmaTestCase
'table1.deleted',
];
$this->assertEquals(
'FROM `table1`
',
'FROM `table1`' . "\n",
$this->_callProtectedFunction(
'_getSQLQuery',
[['`table1`.`id`']]

View File

@ -181,82 +181,80 @@ class InnodbTest extends PmaTestCase
public function testGetPageBufferpool()
{
$this->assertEquals(
'<table class="data" id="table_innodb_bufferpool_usage">
<caption class="tblHeaders">
Buffer Pool Usage
</caption>
<tfoot>
<tr>
<th colspan="2">
Total
: 4,096&nbsp;pages / 65,536&nbsp;KiB
</th>
</tr>
</tfoot>
<tbody>
<tr>
<th>Free pages</th>
<td class="value">0</td>
</tr>
<tr>
<th>Dirty pages</th>
<td class="value">0</td>
</tr>
<tr>
<th>Pages containing data</th>
<td class="value">0
</td>
</tr>
<tr>
<th>Pages to be flushed</th>
<td class="value">0
</td>
</tr>
<tr>
<th>Busy pages</th>
<td class="value">0
</td>
</tr> </tbody>
</table>
<table class="data" id="table_innodb_bufferpool_activity">
<caption class="tblHeaders">
Buffer Pool Activity
</caption>
<tbody>
<tr>
<th>Read requests</th>
<td class="value">64
</td>
</tr>
<tr>
<th>Write requests</th>
<td class="value">64
</td>
</tr>
<tr>
<th>Read misses</th>
<td class="value">32
</td>
</tr>
<tr>
<th>Write waits</th>
<td class="value">0
</td>
</tr>
<tr>
<th>Read misses in %</th>
<td class="value">50 %
</td>
</tr>
<tr>
<th>Write waits in %</th>
<td class="value">0 %
</td>
</tr>
</tbody>
</table>
',
'<table class="data" id="table_innodb_bufferpool_usage">' . "\n" .
' <caption class="tblHeaders">' . "\n" .
' Buffer Pool Usage' . "\n" .
' </caption>' . "\n" .
' <tfoot>' . "\n" .
' <tr>' . "\n" .
' <th colspan="2">' . "\n" .
' Total' . "\n" .
' : 4,096&nbsp;pages / 65,536&nbsp;KiB' . "\n" .
' </th>' . "\n" .
' </tr>' . "\n" .
' </tfoot>' . "\n" .
' <tbody>' . "\n" .
' <tr>' . "\n" .
' <th>Free pages</th>' . "\n" .
' <td class="value">0</td>' . "\n" .
' </tr>' . "\n" .
' <tr>' . "\n" .
' <th>Dirty pages</th>' . "\n" .
' <td class="value">0</td>' . "\n" .
' </tr>' . "\n" .
' <tr>' . "\n" .
' <th>Pages containing data</th>' . "\n" .
' <td class="value">0' . "\n" .
'</td>' . "\n" .
' </tr>' . "\n" .
' <tr>' . "\n" .
' <th>Pages to be flushed</th>' . "\n" .
' <td class="value">0' . "\n" .
'</td>' . "\n" .
' </tr>' . "\n" .
' <tr>' . "\n" .
' <th>Busy pages</th>' . "\n" .
' <td class="value">0' . "\n" .
'</td>' . "\n" .
' </tr> </tbody>' . "\n" .
'</table>' . "\n" . "\n" .
'<table class="data" id="table_innodb_bufferpool_activity">' . "\n" .
' <caption class="tblHeaders">' . "\n" .
' Buffer Pool Activity' . "\n" .
' </caption>' . "\n" .
' <tbody>' . "\n" .
' <tr>' . "\n" .
' <th>Read requests</th>' . "\n" .
' <td class="value">64' . "\n" .
'</td>' . "\n" .
' </tr>' . "\n" .
' <tr>' . "\n" .
' <th>Write requests</th>' . "\n" .
' <td class="value">64' . "\n" .
'</td>' . "\n" .
' </tr>' . "\n" .
' <tr>' . "\n" .
' <th>Read misses</th>' . "\n" .
' <td class="value">32' . "\n" .
'</td>' . "\n" .
' </tr>' . "\n" .
' <tr>' . "\n" .
' <th>Write waits</th>' . "\n" .
' <td class="value">0' . "\n" .
'</td>' . "\n" .
' </tr>' . "\n" .
' <tr>' . "\n" .
' <th>Read misses in %</th>' . "\n" .
' <td class="value">50 %' . "\n" .
'</td>' . "\n" .
' </tr>' . "\n" .
' <tr>' . "\n" .
' <th>Write waits in %</th>' . "\n" .
' <td class="value">0 %' . "\n" .
'</td>' . "\n" .
' </tr>' . "\n" .
' </tbody>' . "\n" .
'</table>' . "\n",
$this->object->getPageBufferpool()
);
}

View File

@ -2090,6 +2090,7 @@ class UtilTest extends PmaTestCase
*/
public function providerLocalisedDate()
{
$hasJaTranslations = file_exists(LOCALE_PATH . '/cs/LC_MESSAGES/phpmyadmin.mo');
return [
[
1227455558,
@ -2136,21 +2137,21 @@ class UtilTest extends PmaTestCase
[
1227455558,
'%Y-%m-%d %H:%M:%S %a',
'2008-11-24 00:52:38 月',
$hasJaTranslations ? '2008-11-24 00:52:38 月' : '2008-11-24 00:52:38 Mon',
'Asia/Tokyo',
'ja',
],
[
1227455558,
'%a %A %b %B',
'月 月 11 月 11 月',
$hasJaTranslations ? '月 月 11 月 11 月' : 'Mon Mon Nov Nov',
'Asia/Tokyo',
'ja',
],
[
1227455558,
'%a %A %b %B %P',
'月 月 11 月 11 月 午前',
$hasJaTranslations ? '月 月 11 月 11 月 午前' : 'Mon Mon Nov Nov AM',
'Asia/Tokyo',
'ja',
],