1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-12 01:19:47 +01:00
PHP-Parser/test/PhpParser/BuilderFactoryTest.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'),
);
}
}