Skip to content

Commit

Permalink
Merge #15960 - Windows fixes for testsuite and test fixes
Browse files Browse the repository at this point in the history
Pull-request: #15960

Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Feb 15, 2020
2 parents efcd4be + 1e38497 commit a4fcf79
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 92 deletions.
4 changes: 2 additions & 2 deletions libraries/classes/DatabaseInterface.php
Expand Up @@ -794,7 +794,7 @@ function ($a, $b) {
$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';
Expand Down Expand Up @@ -957,7 +957,7 @@ public function getDatabasesFull(
$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);
}

Expand Down
17 changes: 8 additions & 9 deletions test/classes/CoreTest.php
Expand Up @@ -703,18 +703,17 @@ public function testSendHeaderLocationIisLongUri()
$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);

Expand Down
3 changes: 1 addition & 2 deletions test/classes/Database/QbeTest.php
Expand Up @@ -599,8 +599,7 @@ public function testGetSQLQuery()
'table1.deleted',
];
$this->assertEquals(
'FROM `table1`
',
'FROM `table1`' . "\n",
$this->_callProtectedFunction(
'_getSQLQuery',
[['`table1`.`id`']]
Expand Down
150 changes: 74 additions & 76 deletions test/classes/Engines/InnodbTest.php
Expand Up @@ -181,82 +181,80 @@ public function testGetInfoPages()
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()
);
}
Expand Down
7 changes: 4 additions & 3 deletions test/classes/UtilTest.php
Expand Up @@ -2090,6 +2090,7 @@ public function testLocalisedDate(int $a, string $b, string $e, string $tz, stri
*/
public function providerLocalisedDate()
{
$hasJaTranslations = file_exists(LOCALE_PATH . '/cs/LC_MESSAGES/phpmyadmin.mo');
return [
[
1227455558,
Expand Down Expand Up @@ -2136,21 +2137,21 @@ public function providerLocalisedDate()
[
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',
],
Expand Down

0 comments on commit a4fcf79

Please sign in to comment.