Add test case for PMA_extractFieldSpec

This commit is contained in:
Michal Čihař 2011-08-04 16:03:56 +02:00
parent b231ab4072
commit 1c356718ea

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