ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.133.132.82 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/nicnAdmin/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/ |
Upload File : |
<?php /** * This file is part of phpDocumentor. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * @copyright 2010-2015 Mike van Riel<mike@phpdoc.org> * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ namespace phpDocumentor\Reflection\DocBlock; use Mockery as m; use phpDocumentor\Reflection\DocBlock; /** * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Serializer * @covers ::<private> */ class SerializerTest extends \PHPUnit_Framework_TestCase { /** * @covers ::__construct * @covers ::getDocComment * @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter * @uses phpDocumentor\Reflection\DocBlock * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\Generic */ public function testReconstructsADocCommentFromADocBlock() { $expected = <<<'DOCCOMMENT' /** * This is a summary * * This is a description * * @unknown-tag Test description for the unknown tag */ DOCCOMMENT; $fixture = new Serializer(); $docBlock = new DocBlock( 'This is a summary', new Description('This is a description'), [ new DocBlock\Tags\Generic('unknown-tag', new Description('Test description for the unknown tag')) ] ); $this->assertSame($expected, $fixture->getDocComment($docBlock)); } /** * @covers ::__construct * @covers ::getDocComment * @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter * @uses phpDocumentor\Reflection\DocBlock * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\Generic */ public function testAddPrefixToDocBlock() { $expected = <<<'DOCCOMMENT' aa/** aa * This is a summary aa * aa * This is a description aa * aa * @unknown-tag Test description for the unknown tag aa */ DOCCOMMENT; $fixture = new Serializer(2, 'a'); $docBlock = new DocBlock( 'This is a summary', new Description('This is a description'), [ new DocBlock\Tags\Generic('unknown-tag', new Description('Test description for the unknown tag')) ] ); $this->assertSame($expected, $fixture->getDocComment($docBlock)); } /** * @covers ::__construct * @covers ::getDocComment * @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter * @uses phpDocumentor\Reflection\DocBlock * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\Generic */ public function testAddPrefixToDocBlockExceptFirstLine() { $expected = <<<'DOCCOMMENT' /** aa * This is a summary aa * aa * This is a description aa * aa * @unknown-tag Test description for the unknown tag aa */ DOCCOMMENT; $fixture = new Serializer(2, 'a', false); $docBlock = new DocBlock( 'This is a summary', new Description('This is a description'), [ new DocBlock\Tags\Generic('unknown-tag', new Description('Test description for the unknown tag')) ] ); $this->assertSame($expected, $fixture->getDocComment($docBlock)); } /** * @covers ::__construct * @covers ::getDocComment * @uses phpDocumentor\Reflection\DocBlock\Description * @uses phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter * @uses phpDocumentor\Reflection\DocBlock * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses phpDocumentor\Reflection\DocBlock\Tags\Generic */ public function testWordwrapsAroundTheGivenAmountOfCharacters() { $expected = <<<'DOCCOMMENT' /** * This is a * summary * * This is a * description * * @unknown-tag * Test * description * for the * unknown tag */ DOCCOMMENT; $fixture = new Serializer(0, '', true, 15); $docBlock = new DocBlock( 'This is a summary', new Description('This is a description'), [ new DocBlock\Tags\Generic('unknown-tag', new Description('Test description for the unknown tag')) ] ); $this->assertSame($expected, $fixture->getDocComment($docBlock)); } /** * @covers ::__construct * @expectedException \InvalidArgumentException */ public function testInitializationFailsIfIndentIsNotAnInteger() { new Serializer([]); } /** * @covers ::__construct * @expectedException \InvalidArgumentException */ public function testInitializationFailsIfIndentStringIsNotAString() { new Serializer(0, []); } /** * @covers ::__construct * @expectedException \InvalidArgumentException */ public function testInitializationFailsIfIndentFirstLineIsNotABoolean() { new Serializer(0, '', []); } /** * @covers ::__construct * @expectedException \InvalidArgumentException */ public function testInitializationFailsIfLineLengthIsNotNullNorAnInteger() { new Serializer(0, '', false, []); } }