You are here

public function PHP_Token_FunctionTest::testSignature in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpunit/php-token-stream/tests/Token/FunctionTest.php \PHP_Token_FunctionTest::testSignature()

File

vendor/phpunit/php-token-stream/tests/Token/FunctionTest.php, line 119

Class

PHP_Token_FunctionTest
Tests for the PHP_Token_FUNCTION class.

Code

public function testSignature() {
  $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'source5.php');
  $f = $ts
    ->getFunctions();
  $c = $ts
    ->getClasses();
  $i = $ts
    ->getInterfaces();
  $this
    ->assertEquals('foo($a, array $b, array $c = array())', $f['foo']['signature']);
  $this
    ->assertEquals('m($a, array $b, array $c = array())', $c['c']['methods']['m']['signature']);
  $this
    ->assertEquals('m($a, array $b, array $c = array())', $c['a']['methods']['m']['signature']);
  $this
    ->assertEquals('m($a, array $b, array $c = array())', $i['i']['methods']['m']['signature']);
}