Skip to content

Commit

Permalink
Add tests for #16836
Browse files Browse the repository at this point in the history
Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Apr 19, 2021
1 parent fe306b2 commit ae4518b
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions test/classes/Display/ResultsTest.php
Expand Up @@ -1296,4 +1296,50 @@ public function testGetSortOrderHiddenInputs(
'The first line should contain the URL params'
);
}

/**
* @see https://github.com/phpmyadmin/phpmyadmin/issues/16836
*/
public function testBuildValueDisplayNoTrainlingSpaces(): void
{
$output = $this->callFunction(
$this->object,
DisplayResults::class,
'buildValueDisplay',
[
'my_class',
false,
' special value ',
]
);
$this->assertSame('<td class="left my_class"> special value </td>' . "\n", $output);
$output = $this->callFunction(
$this->object,
DisplayResults::class,
'buildValueDisplay',
[
'my_class',
false,
'0x11e6ac0cfb1e8bf3bf48b827ebdafb0b',
]
);
$this->assertSame(
'<td class="left my_class">0x11e6ac0cfb1e8bf3bf48b827ebdafb0b</td>' . "\n",
$output
);
$output = $this->callFunction(
$this->object,
DisplayResults::class,
'buildValueDisplay',
[
'my_class',
true,// condition mode
'0x11e6ac0cfb1e8bf3bf48b827ebdafb0b',
]
);
$this->assertSame(
'<td class="left my_class condition">0x11e6ac0cfb1e8bf3bf48b827ebdafb0b</td>' . "\n",
$output
);
}
}

0 comments on commit ae4518b

Please sign in to comment.