mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-12-02 17:38:19 +01:00
25 lines
780 B
PHP
25 lines
780 B
PHP
<?php
|
|
|
|
namespace PhpParser;
|
|
|
|
class BuilderFactoryTest extends \PHPUnit_Framework_TestCase
|
|
{
|
|
/**
|
|
* @dataProvider provideTestFactory
|
|
*/
|
|
public function testFactory($methodName, $className) {
|
|
$factory = new BuilderFactory;
|
|
$this->assertInstanceOf($className, $factory->$methodName('test'));
|
|
}
|
|
|
|
public function provideTestFactory() {
|
|
return array(
|
|
array('class', 'PhpParser\Builder\Class_'),
|
|
array('interface', 'PhpParser\Builder\Interface_'),
|
|
array('method', 'PhpParser\Builder\Method'),
|
|
array('function', 'PhpParser\Builder\Function_'),
|
|
array('property', 'PhpParser\Builder\Property'),
|
|
array('param', 'PhpParser\Builder\Param'),
|
|
);
|
|
}
|
|
} |