Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWilliam Desportes <williamdes@wdes.fr>2021-04-19 20:00:35 +0300
committerWilliam Desportes <williamdes@wdes.fr>2021-04-19 20:00:35 +0300
commitae4518be9b67b4a8e4fa837265019baab804e2d4 (patch)
treef6f03b0ed006f60f2ac14aeabec9699021e86bdf /test
parentfe306b28ee24ff17cd41adbcda373fab09591a29 (diff)
Add tests for #16836
Signed-off-by: William Desportes <williamdes@wdes.fr>
Diffstat (limited to 'test')
-rw-r--r--test/classes/Display/ResultsTest.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/classes/Display/ResultsTest.php b/test/classes/Display/ResultsTest.php
index 58a656dabb..29b32448dd 100644
--- a/test/classes/Display/ResultsTest.php
+++ b/test/classes/Display/ResultsTest.php
@@ -1296,4 +1296,50 @@ class ResultsTest extends AbstractTestCase
'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
+ );
+ }
}