PageRenderTime 45ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/Tests/Unit/Reflection/DocCommentParserTest.php

https://github.com/christianjul/FLOW3-Composer
PHP | 38 lines | 15 code | 5 blank | 18 comment | 0 complexity | fa32a8f8106d819c2d64039d85119f5b MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-3.0
  1. <?php
  2. namespace TYPO3\FLOW3\Tests\Unit\Reflection;
  3. /* *
  4. * This script belongs to the FLOW3 framework. *
  5. * *
  6. * It is free software; you can redistribute it and/or modify it under *
  7. * the terms of the GNU Lesser General Public License, either version 3 *
  8. * of the License, or (at your option) any later version. *
  9. * *
  10. * The TYPO3 project - inspiring people to share! *
  11. * */
  12. /**
  13. * Testcase for DocCommentParser
  14. */
  15. class DocCommentParserTest extends \TYPO3\FLOW3\Tests\UnitTestCase {
  16. /**
  17. * @test
  18. */
  19. public function descriptionWithOneLineIsParsedCorrectly() {
  20. $parser = new \TYPO3\FLOW3\Reflection\DocCommentParser();
  21. $parser->parseDocComment('/**' . chr(10) . ' * Testcase for DocCommentParser' . chr(10) . ' */');
  22. $this->assertEquals('Testcase for DocCommentParser', $parser->getDescription());
  23. }
  24. /**
  25. * @test
  26. */
  27. public function eolCharacterCanBeNewlineOrCarriageReturn() {
  28. $parser = new \TYPO3\FLOW3\Reflection\DocCommentParser();
  29. $parser->parseDocComment('/**' . chr(10) . ' * @var $foo integer' . chr(13) . chr(10) . ' * @var $bar string' . chr(10) . ' */');
  30. $this->assertEquals(array('$foo integer', '$bar string'), $parser->getTagValues('var'));
  31. }
  32. }
  33. ?>