Add test case for PMA_extractFieldSpec
This commit is contained in:
parent
b231ab4072
commit
1c356718ea
44
test/libraries/common/PMA_extractFieldSpec_test.php
Normal file
44
test/libraries/common/PMA_extractFieldSpec_test.php
Normal file
@ -0,0 +1,44 @@
|
||||
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Test for PMA_checkParameters from common.lib.php
|
||||
*
|
||||
* @package phpMyAdmin-test
|
||||
* @version $Id: PMA_checkParameters_test.php
|
||||
* @group common.lib-tests
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include to test.
|
||||
*/
|
||||
require_once 'libraries/common.lib.php';
|
||||
|
||||
class PMA_extractFieldSpec_test extends PHPUnit_Extensions_OutputTestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider provider
|
||||
*/
|
||||
public function testParsing($in, $out)
|
||||
{
|
||||
$this->assertEquals($out, PMA_extractFieldSpec($in));
|
||||
}
|
||||
|
||||
public function provider()
|
||||
{
|
||||
return array(
|
||||
array(
|
||||
"SET('a', 'b')",
|
||||
array(
|
||||
'type' => 'set',
|
||||
'short_type' => 'set',
|
||||
'binary' => false,
|
||||
'unsigned' => false,
|
||||
'zerofill' => false,
|
||||
'spec_in_brackets' => "'a', 'b'",
|
||||
'enum_set_values' => array('a', 'b'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user