Update website
This commit is contained in:
parent
4413528994
commit
1d90fbf296
6865 changed files with 1091082 additions and 0 deletions
47
vendor/doctrine/rst-parser/tests/LiteralNestedInDirective/BuilderTest.php
vendored
Normal file
47
vendor/doctrine/rst-parser/tests/LiteralNestedInDirective/BuilderTest.php
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\Tests\RST\LiteralNestedInDirective;
|
||||
|
||||
use Doctrine\RST\Builder;
|
||||
use Doctrine\RST\Configuration;
|
||||
use Doctrine\RST\Kernel;
|
||||
use Doctrine\Tests\RST\BaseBuilderTest;
|
||||
|
||||
use function shell_exec;
|
||||
|
||||
/**
|
||||
* Unit testing for RST
|
||||
*/
|
||||
class BuilderTest extends BaseBuilderTest
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
shell_exec('rm -rf ' . $this->targetFile());
|
||||
|
||||
$kernel = new Kernel(
|
||||
new Configuration(),
|
||||
[new TipDirective()]
|
||||
);
|
||||
|
||||
$this->builder = new Builder($kernel);
|
||||
$this->builder->getConfiguration()->setUseCachedMetas(false);
|
||||
|
||||
$this->builder->build($this->sourceFile(), $this->targetFile());
|
||||
}
|
||||
|
||||
public function testLiteralNestedInDirective(): void
|
||||
{
|
||||
$contents = $this->getFileContents($this->targetFile('index.html'));
|
||||
|
||||
self::assertStringContainsString('class="tip"', $contents);
|
||||
self::assertStringContainsString('<code', $contents);
|
||||
self::assertStringContainsString('</code>', $contents);
|
||||
}
|
||||
|
||||
protected function getFixturesDirectory(): string
|
||||
{
|
||||
return 'LiteralNestedInDirective';
|
||||
}
|
||||
}
|
26
vendor/doctrine/rst-parser/tests/LiteralNestedInDirective/TipDirective.php
vendored
Normal file
26
vendor/doctrine/rst-parser/tests/LiteralNestedInDirective/TipDirective.php
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\Tests\RST\LiteralNestedInDirective;
|
||||
|
||||
use Doctrine\RST\Directives\SubDirective;
|
||||
use Doctrine\RST\Nodes\Node;
|
||||
use Doctrine\RST\Parser;
|
||||
|
||||
class TipDirective extends SubDirective
|
||||
{
|
||||
/** @param string[] $options */
|
||||
final public function processSub(Parser $parser, ?Node $document, string $variable, string $data, array $options): ?Node
|
||||
{
|
||||
return $parser->getNodeFactory()->createWrapperNode($document, '<div class="tip">', '</div>');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the directive name
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return 'tip';
|
||||
}
|
||||
}
|
9
vendor/doctrine/rst-parser/tests/LiteralNestedInDirective/input/index.rst
vendored
Normal file
9
vendor/doctrine/rst-parser/tests/LiteralNestedInDirective/input/index.rst
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
|
||||
.. tip::
|
||||
|
||||
here is a tip with literal::
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
|
||||
/** @var ClassLoader $loader */
|
||||
$loader = require __DIR__.'/../vendor/autoload.php';
|
Loading…
Add table
Add a link
Reference in a new issue