BuilderFactoryTest.php 780 B

1234567891011121314151617181920212223
  1. <?php
  2. class PHPParser_Tests_BuilderFactoryTest extends PHPUnit_Framework_TestCase
  3. {
  4. /**
  5. * @dataProvider provideTestFactory
  6. */
  7. public function testFactory($methodName, $className) {
  8. $factory = new PHPParser_BuilderFactory;
  9. $this->assertInstanceOf($className, $factory->$methodName('test'));
  10. }
  11. public function provideTestFactory() {
  12. return array(
  13. array('class', 'PHPParser_Builder_Class'),
  14. array('interface', 'PHPParser_Builder_Interface'),
  15. array('method', 'PHPParser_Builder_Method'),
  16. array('function', 'PHPParser_Builder_Function'),
  17. array('property', 'PHPParser_Builder_Property'),
  18. array('param', 'PHPParser_Builder_Param'),
  19. );
  20. }
  21. }