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
|
|
|
}
|