1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-04 18:28:25 +01:00
PHP-Parser/test/PHPParser/Tests/BuilderFactoryTest.php

23 lines
780 B
PHP
Raw Normal View History

2012-03-10 17:56:56 +01:00
<?php
class PHPParser_Tests_BuilderFactoryTest extends PHPUnit_Framework_TestCase
{
2013-05-23 10:31:59 +02:00
/**
* @dataProvider provideTestFactory
*/
public function testFactory($methodName, $className) {
2012-03-10 17:56:56 +01:00
$factory = new PHPParser_BuilderFactory;
2013-05-23 10:31:59 +02:00
$this->assertInstanceOf($className, $factory->$methodName('test'));
2012-03-10 23:25:26 +01:00
}
2012-03-10 17:56:56 +01:00
2013-05-23 10:31:59 +02:00
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'),
);
2012-03-11 09:02:52 +01:00
}
2012-03-10 17:56:56 +01:00
}