Орла
Области
Компаний
Пользователи
Галерея
Фиксированные новости
Орла
Отзывы о фирмах
Тарифы
Пользователи
Области
Банкоматы
Торговые точки
Доска объявлений
Курсы валют
Скидки
организации Орла
организации области
товары
сайты
сайты Орел
Данные
Разделы
Поиск
Поиск запросы
Статистика
Показы каталога организаций
Статистика клиенты
Пользователи
Сайты
Управление сайтом
Анкета
Аптеки
Афиша
Афиша новая
Баннеры
Бизнес >
Викторина
Голосование
Гость на сайте
Истории
Календарь событий
Каталоги >
Конкурс красоты
Конкурс аудио
Консультации
Меню
Новое на сайте
Новости >
Организации >
Программа ТВ
Публикации
Разделы сайта
Рассылка
Рестораны
Секрет фирмы >
Сервисы >
Ссылки
Тесты
Файловый менеджер
Форум
Фотогалерея
Обратная связь
Недвижимость
Новый год
Тексты
Пользователи
Юридический рейтинг
Отзывы на товары
Бан пользователей
Жалобы
Новые тесты
Коронавирус
Файловый менеджер
Имя файла
DescriptionTest.php
Содержимое
<?php /** * phpDocumentor Description Test * * PHP Version 5.3 * * @author Vasil Rangelov <boen.robot@gmail.com> * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ namespace phpDocumentor\Reflection\DocBlock; /** * Test class for \phpDocumentor\Reflection\DocBlock\Description * * @author Vasil Rangelov <boen.robot@gmail.com> * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ class DescriptionTest extends \PHPUnit_Framework_TestCase { public function testConstruct() { $fixture = <<<LONGDESC This is text for a description. LONGDESC; $object = new Description($fixture); $this->assertSame($fixture, $object->getContents()); $parsedContents = $object->getParsedContents(); $this->assertCount(1, $parsedContents); $this->assertSame($fixture, $parsedContents[0]); } public function testInlineTagParsing() { $fixture = <<<LONGDESC This is text for a {@link http://phpdoc.org/ description} that uses inline tags. LONGDESC; $object = new Description($fixture); $this->assertSame($fixture, $object->getContents()); $parsedContents = $object->getParsedContents(); $this->assertCount(3, $parsedContents); $this->assertSame('This is text for a ', $parsedContents[0]); $this->assertInstanceOf( __NAMESPACE__ . '\Tag\LinkTag', $parsedContents[1] ); $this->assertSame( ' that uses inline tags.', $parsedContents[2] ); } public function testInlineTagAtStartParsing() { $fixture = <<<LONGDESC {@link http://phpdoc.org/ This} is text for a description that uses inline tags. LONGDESC; $object = new Description($fixture); $this->assertSame($fixture, $object->getContents()); $parsedContents = $object->getParsedContents(); $this->assertCount(3, $parsedContents); $this->assertSame('', $parsedContents[0]); $this->assertInstanceOf( __NAMESPACE__ . '\Tag\LinkTag', $parsedContents[1] ); $this->assertSame( ' is text for a description that uses inline tags.', $parsedContents[2] ); } public function testNestedInlineTagParsing() { $fixture = <<<LONGDESC This is text for a description with {@internal inline tag with {@link http://phpdoc.org another inline tag} in it}. LONGDESC; $object = new Description($fixture); $this->assertSame($fixture, $object->getContents()); $parsedContents = $object->getParsedContents(); $this->assertCount(3, $parsedContents); $this->assertSame( 'This is text for a description with ', $parsedContents[0] ); $this->assertInstanceOf( __NAMESPACE__ . '\Tag', $parsedContents[1] ); $this->assertSame('.', $parsedContents[2]); $parsedDescription = $parsedContents[1]->getParsedDescription(); $this->assertCount(3, $parsedDescription); $this->assertSame("inline tag with\n", $parsedDescription[0]); $this->assertInstanceOf( __NAMESPACE__ . '\Tag\LinkTag', $parsedDescription[1] ); $this->assertSame(' in it', $parsedDescription[2]); } public function testLiteralOpeningDelimiter() { $fixture = <<<LONGDESC This is text for a description containing { that is literal. LONGDESC; $object = new Description($fixture); $this->assertSame($fixture, $object->getContents()); $parsedContents = $object->getParsedContents(); $this->assertCount(1, $parsedContents); $this->assertSame($fixture, $parsedContents[0]); } public function testNestedLiteralOpeningDelimiter() { $fixture = <<<LONGDESC This is text for a description containing {@internal inline tag that has { that is literal}. LONGDESC; $object = new Description($fixture); $this->assertSame($fixture, $object->getContents()); $parsedContents = $object->getParsedContents(); $this->assertCount(3, $parsedContents); $this->assertSame( 'This is text for a description containing ', $parsedContents[0] ); $this->assertInstanceOf( __NAMESPACE__ . '\Tag', $parsedContents[1] ); $this->assertSame('.', $parsedContents[2]); $this->assertSame( array('inline tag that has { that is literal'), $parsedContents[1]->getParsedDescription() ); } public function testLiteralClosingDelimiter() { $fixture = <<<LONGDESC This is text for a description with {} that is not a tag. LONGDESC; $object = new Description($fixture); $this->assertSame($fixture, $object->getContents()); $parsedContents = $object->getParsedContents(); $this->assertCount(1, $parsedContents); $this->assertSame( 'This is text for a description with } that is not a tag.', $parsedContents[0] ); } public function testNestedLiteralClosingDelimiter() { $fixture = <<<LONGDESC This is text for a description with {@internal inline tag with {} that is not an inline tag}. LONGDESC; $object = new Description($fixture); $this->assertSame($fixture, $object->getContents()); $parsedContents = $object->getParsedContents(); $this->assertCount(3, $parsedContents); $this->assertSame( 'This is text for a description with ', $parsedContents[0] ); $this->assertInstanceOf( __NAMESPACE__ . '\Tag', $parsedContents[1] ); $this->assertSame('.', $parsedContents[2]); $this->assertSame( array('inline tag with } that is not an inline tag'), $parsedContents[1]->getParsedDescription() ); } public function testInlineTagEscapingSequence() { $fixture = <<<LONGDESC This is text for a description with literal {{@}link}. LONGDESC; $object = new Description($fixture); $this->assertSame($fixture, $object->getContents()); $parsedContents = $object->getParsedContents(); $this->assertCount(1, $parsedContents); $this->assertSame( 'This is text for a description with literal {@link}.', $parsedContents[0] ); } public function testNestedInlineTagEscapingSequence() { $fixture = <<<LONGDESC This is text for a description with an {@internal inline tag with literal {{@}link{} in it}. LONGDESC; $object = new Description($fixture); $this->assertSame($fixture, $object->getContents()); $parsedContents = $object->getParsedContents(); $this->assertCount(3, $parsedContents); $this->assertSame( 'This is text for a description with an ', $parsedContents[0] ); $this->assertInstanceOf( __NAMESPACE__ . '\Tag', $parsedContents[1] ); $this->assertSame('.', $parsedContents[2]); $this->assertSame( array('inline tag with literal {@link} in it'), $parsedContents[1]->getParsedDescription() ); } }
/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/
Имя
Дата
Размер
..
2016-01-25
Tag
2016-01-25
Type
2016-01-25
DescriptionTest.php
2016-01-25
7 кб.
DescriptionTest.php~
2025-01-10
7 кб.
TagTest.php
2016-01-25
8 кб.
TagTest.php~
2025-01-10
8 кб.
/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock
Загрузить файлы
Файл 1
Файл 2
Файл 3