Merge pull request #278 from marc1706/ticket/277
[ticket/277] Add tests for functions_modules.php
This commit is contained in:
76
tests/unit/functions/functions_modules_test.php
Normal file
76
tests/unit/functions/functions_modules_test.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package Board3 Portal testing
|
||||
* @copyright (c) Board3 Group ( www.board3.de )
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/../../../includes/functions_modules.php');
|
||||
|
||||
class phpbb_functions_functions_modules_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function data_column_num_string()
|
||||
{
|
||||
return array(
|
||||
array(0, ''),
|
||||
array(0, false),
|
||||
array('left', 1),
|
||||
array('center', 2),
|
||||
array('right', 3),
|
||||
array('top', 4),
|
||||
array('bottom', 5),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data_column_num_string
|
||||
*/
|
||||
public function test_column_num_string($expected, $input)
|
||||
{
|
||||
$this->assertEquals($expected, column_num_string($input));
|
||||
}
|
||||
|
||||
public function data_column_string_num()
|
||||
{
|
||||
return array(
|
||||
array(0, ''),
|
||||
array(0, false),
|
||||
array(1, 'left'),
|
||||
array(2, 'center'),
|
||||
array(3, 'right'),
|
||||
array(4, 'top'),
|
||||
array(5, 'bottom'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data_column_string_num
|
||||
*/
|
||||
public function test_column_string_num($expected, $input)
|
||||
{
|
||||
$this->assertEquals($expected, column_string_num($input));
|
||||
}
|
||||
|
||||
public function data_column_string_const()
|
||||
{
|
||||
return array(
|
||||
array(0, ''),
|
||||
array(0, ''),
|
||||
array(2, 'left'),
|
||||
array(4, 'center'),
|
||||
array(8, 'right'),
|
||||
array(1, 'top'),
|
||||
array(16, 'bottom'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data_column_string_const
|
||||
*/
|
||||
public function test_column_string_const($expected, $input)
|
||||
{
|
||||
$this->assertEquals($expected, column_string_const($input));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user