Skip to content

Commit

Permalink
add test for 56
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jul 17, 2023
1 parent 48a3c23 commit ff8122f
Show file tree
Hide file tree
Showing 2 changed files with 258 additions and 0 deletions.
199 changes: 199 additions & 0 deletions test/unit/ns.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,204 @@ <h2>Cross linking<a class="headerlink" href="#cross-linking" title="Permalink to
</ul>
</section>
</section>
<section id="namespace-Foo\Bar">
<span id="ns-can-be-changed"/>
<h1>NS can be changed<a class="headerlink" href="#namespace-Foo\Bar" title="Permalink to this heading">&#xB6;</a></h1>
<dl class="php class">
<dt class="sig sig-object php" id="Foo\Bar\A">
<em class="property">
<span class="pre">class</span>
</em>
<span class="sig-prename descclassname">
<span class="pre">Foo\Bar\</span>
</span>
<span class="sig-name descname">
<span class="pre">A</span>
</span>
<a class="headerlink" href="#Foo\Bar\A" title="Permalink to this definition">&#xB6;</a>
</dt>
<dd/>
</dl>
<dl class="php method">
<dt class="sig sig-object php" id="Foo\Bar\A::simplify">
<span class="sig-prename descclassname">
<span class="pre">Foo\Bar\A::</span>
</span>
<span class="sig-name descname">
<span class="pre">simplify</span>
</span>
<span class="sig-paren">(</span>
<span class="sig-paren">)</span>
<a class="headerlink" href="#Foo\Bar\A::simplify" title="Permalink to this definition">&#xB6;</a>
</dt>
<dd/>
</dl>
<span class="target" id="namespace-Bar"/>
<dl class="php class">
<dt class="sig sig-object php" id="Bar\A">
<em class="property">
<span class="pre">class</span>
</em>
<span class="sig-prename descclassname">
<span class="pre">Bar\</span>
</span>
<span class="sig-name descname">
<span class="pre">A</span>
</span>
<a class="headerlink" href="#Bar\A" title="Permalink to this definition">&#xB6;</a>
</dt>
<dd/>
</dl>
<dl class="php method">
<dt class="sig sig-object php" id="Bar\A::simplify">
<span class="sig-prename descclassname">
<span class="pre">Bar\A::</span>
</span>
<span class="sig-name descname">
<span class="pre">simplify</span>
</span>
<span class="sig-paren">(</span>
<span class="sig-paren">)</span>
<a class="headerlink" href="#Bar\A::simplify" title="Permalink to this definition">&#xB6;</a>
</dt>
<dd/>
</dl>
<section id="id1">
<h2>Cross linking<a class="headerlink" href="#id1" title="Permalink to this heading">&#xB6;</a></h2>
<ul class="simple">
<li>
<p>
<code class="xref php php-meth docutils literal notranslate">
<span class="pre">\Foo\Bar::simplify</span>
</code>
</p>
</li>
<li>
<p>
<a class="reference internal" href="#Bar\A::simplify" title="Bar\A::simplify">
<code class="xref php php-meth docutils literal notranslate">
<span class="pre">A::simplify</span>
</code>
</a>
</p>
</li>
</ul>
</section>
</section>
<section id="leading-implies-absolute-class-name">
<h1>Leading <code class="docutils literal notranslate"><span class="pre">\</span></code> implies absolute class name<a class="headerlink" href="#leading-implies-absolute-class-name" title="Permalink to this heading">&#xB6;</a></h1>
<dl class="php class">
<dt class="sig sig-object php">
<span class="sig-name descname">
<span class="pre">\A</span>
</span>
</dt>
<dd/>
</dl>
<dl class="php method">
<dt class="sig sig-object php">
<span class="sig-prename descclassname">
<span class="pre">Bar\A::</span>
</span>
<span class="sig-name descname">
<span class="pre">simplify</span>
</span>
<span class="sig-paren">(</span>
<span class="sig-paren">)</span>
</dt>
<dd/>
</dl>
<dl class="php class">
<dt class="sig sig-object php" id="Bar\A2">
<em class="property">
<span class="pre">class</span>
</em>
<span class="sig-prename descclassname">
<span class="pre">Bar\</span>
</span>
<span class="sig-name descname">
<span class="pre">A2</span>
</span>
<a class="headerlink" href="#Bar\A2" title="Permalink to this definition">&#xB6;</a>
</dt>
<dd/>
</dl>
<dl class="php method">
<dt class="sig sig-object php" id="Bar\A2::simplify">
<span class="sig-prename descclassname">
<span class="pre">Bar\A2::</span>
</span>
<span class="sig-name descname">
<span class="pre">simplify</span>
</span>
<span class="sig-paren">(</span>
<span class="sig-paren">)</span>
<a class="headerlink" href="#Bar\A2::simplify" title="Permalink to this definition">&#xB6;</a>
</dt>
<dd/>
</dl>
<section id="id2">
<h2>Cross linking<a class="headerlink" href="#id2" title="Permalink to this heading">&#xB6;</a></h2>
<ul class="simple">
<li>
<p>
<a class="reference internal" href="#Bar\A::simplify" title="Bar\A::simplify">
<code class="xref php php-meth docutils literal notranslate">
<span class="pre">A::simplify</span>
</code>
</a>
</p>
</li>
<li>
<p>
<code class="xref php php-meth docutils literal notranslate">
<span class="pre">\A::simplify</span>
</code>
</p>
</li>
<li>
<p>
<a class="reference internal" href="#Bar\A2::simplify" title="Bar\A2::simplify">
<code class="xref php php-meth docutils literal notranslate">
<span class="pre">A2::simplify</span>
</code>
</a>
</p>
</li>
<li>
<p>
<code class="xref php php-meth docutils literal notranslate">
<span class="pre">\Bar\A2::simplify</span>
</code>
</p>
</li>
</ul>
</section>
</section>
<section id="ns-must-not-be-guessed">
<h1>NS must not be guessed<a class="headerlink" href="#ns-must-not-be-guessed" title="Permalink to this heading">&#xB6;</a></h1>
<div class="note docutils">
<p>These cross references must not have a link as the target methods are not defined.</p>
</div>
<ul class="simple">
<li>
<p>
<code class="xref php php-meth docutils literal notranslate">
<span class="pre">\A2::simplify</span>
</code>
</p>
</li>
</ul>
<span class="target" id="namespace-Bar2"/>
<ul class="simple">
<li>
<p>
<code class="xref php php-meth docutils literal notranslate">
<span class="pre">A::simplify</span>
</code>
</p>
</li>
</ul>
</section>
<div class="clearer"/>
</div>
59 changes: 59 additions & 0 deletions test/unit/ns.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,62 @@
## Cross linking

- {php:meth}`A::simplify`

# NS can be changed

:::{php:namespace} Foo\Bar
:::

:::{php:class} A
:::

:::{php:method} simplify()
:::

:::{php:namespace} Bar
:::

:::{php:class} A
:::

:::{php:method} simplify()
:::

## Cross linking

- {php:meth}`\Foo\Bar::simplify`
- {php:meth}`A::simplify`

# Leading `\` implies absolute class name

:::{php:class} \A
:::

:::{php:method} simplify()
:::

:::{php:class} A2
:::

:::{php:method} simplify()
:::

## Cross linking

- {php:meth}`A::simplify`
- {php:meth}`\A::simplify`
- {php:meth}`A2::simplify`
- {php:meth}`\Bar\A2::simplify`

# NS must not be guessed

:::note
These cross references must not have a link as the target methods are not defined.
:::

- {php:meth}`\A2::simplify`

:::{php:namespace} Bar2
:::

- {php:meth}`A::simplify`

0 comments on commit ff8122f

Please sign in to comment.