1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-28 07:41:55 +03:00

Refactor PMA_printableBitValue_test

Move PMA_printableBitValue_test into UtilTest

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Maurício Meneghini Fauth
2017-09-30 13:08:23 -03:00
parent 1787244efa
commit d3b4c0dcbe
2 changed files with 36 additions and 58 deletions

View File

@@ -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')
);
}
}

View File

@@ -1,58 +0,0 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Test PhpMyAdmin\Util::printableBitValue function
*
* @package PhpMyAdmin-test
* @group common.lib-tests
*/
/*
* Include to test.
*/
/**
* Test PhpMyAdmin\Util::printableBitValue function
*
* @package PhpMyAdmin-test
* @group common.lib-tests
*/
class PMA_PrintableBitValueTest extends PHPUnit_Framework_TestCase
{
/**
* data provider for printable bit value test
*
* @return array
*/
public function printableBitValueDataProvider()
{
return array(
array(
'20131009',
64,
'0000000000000000000000000000000000000001001100110010110011000001'
),
array('5', 32, '00000000000000000000000000000101')
);
}
/**
* 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
*
* @dataProvider printableBitValueDataProvider
*/
public function testPrintableBitValue($a, $b, $e)
{
$this->assertEquals(
$e, PhpMyAdmin\Util::printableBitValue($a, $b)
);
}
}