You are here

protected function PHP_Token_InterfaceTest::setUp in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpunit/php-token-stream/tests/Token/InterfaceTest.php \PHP_Token_InterfaceTest::setUp()

Sets up the fixture, for example, open a network connection. This method is called before a test is executed.

Overrides PHPUnit_Framework_TestCase::setUp

File

vendor/phpunit/php-token-stream/tests/Token/InterfaceTest.php, line 29

Class

PHP_Token_InterfaceTest
Tests for the PHP_Token_INTERFACE class.

Code

protected function setUp() {
  $ts = new PHP_Token_Stream(TEST_FILES_PATH . 'source4.php');
  $i = 0;
  foreach ($ts as $token) {
    if ($token instanceof PHP_Token_CLASS) {
      $this->class = $token;
    }
    elseif ($token instanceof PHP_Token_INTERFACE) {
      $this->interfaces[$i] = $token;
      $i++;
    }
  }
}