From d3b4c0dcbea98aaeda42fe115a2ebfca7652a7f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Sat, 30 Sep 2017 13:08:23 -0300 Subject: [PATCH] Refactor PMA_printableBitValue_test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move PMA_printableBitValue_test into UtilTest Signed-off-by: MaurĂ­cio Meneghini Fauth --- test/classes/UtilTest.php | 36 ++++++++++++ .../common/PMA_printableBitValue_test.php | 58 ------------------- 2 files changed, 36 insertions(+), 58 deletions(-) delete mode 100644 test/libraries/common/PMA_printableBitValue_test.php diff --git a/test/classes/UtilTest.php b/test/classes/UtilTest.php index 9abf67b671..e3536732cb 100644 --- a/test/classes/UtilTest.php +++ b/test/classes/UtilTest.php @@ -1842,4 +1842,40 @@ class UtilTest extends \PMATestCase array(821958, '9 days, 12 hours, 19 minutes and 18 seconds') ); } + + /** + * test for generating string contains printable bit value of selected data + * + * @param integer $a Value + * @param int $b Length + * @param string $e Expected output + * + * @return void + * + * @covers PhpMyAdmin\Util::printableBitValue + * @dataProvider providerPrintableBitValue + */ + public function testPrintableBitValue($a, $b, $e) + { + $this->assertEquals( + $e, Util::printableBitValue($a, $b) + ); + } + + /** + * data provider for printable bit value test + * + * @return array + */ + public function providerPrintableBitValue() + { + return array( + array( + '20131009', + 64, + '0000000000000000000000000000000000000001001100110010110011000001' + ), + array('5', 32, '00000000000000000000000000000101') + ); + } } diff --git a/test/libraries/common/PMA_printableBitValue_test.php b/test/libraries/common/PMA_printableBitValue_test.php deleted file mode 100644 index 8b9ea80c4f..0000000000 --- a/test/libraries/common/PMA_printableBitValue_test.php +++ /dev/null @@ -1,58 +0,0 @@ -assertEquals( - $e, PhpMyAdmin\Util::printableBitValue($a, $b) - ); - } -}