|
| 1 | +--TEST-- |
| 2 | +Attribute formatting 006 - methodparam attribute rendering (inline) |
| 3 | +--FILE-- |
| 4 | +<?php |
| 5 | +namespace phpdotnet\phd; |
| 6 | + |
| 7 | +require_once __DIR__ . "/../../setup.php"; |
| 8 | + |
| 9 | +$xmlFile = __DIR__ . "/data/attribute_formatting_006.xml"; |
| 10 | + |
| 11 | +$config->xmlFile = $xmlFile; |
| 12 | + |
| 13 | +$format = new TestGenericChunkedXHTML($config, $outputHandler); |
| 14 | + |
| 15 | +$format->SQLiteIndex( |
| 16 | + null, null, |
| 17 | + "class.sensitiveparameter", |
| 18 | + "class.sensitiveparameter", |
| 19 | + "", "", "", "", "", "", 0, |
| 20 | +); |
| 21 | +$format->SQLiteIndex( |
| 22 | + null, null, |
| 23 | + "class.deprecated", |
| 24 | + "class.deprecated", |
| 25 | + "", "", "", "", "", "", 0, |
| 26 | +); |
| 27 | +$format->SQLiteIndex( |
| 28 | + null, null, |
| 29 | + "class.attribute", |
| 30 | + "class.attribute", |
| 31 | + "", "", "", "", "", "", 0, |
| 32 | +); |
| 33 | +$format->SQLiteIndex( |
| 34 | + null, null, |
| 35 | + "attribute.constants.target-parameter", |
| 36 | + "class.attribute", |
| 37 | + "", "", "", "", "", "", 0, |
| 38 | +); |
| 39 | +$format->SQLiteIndex( |
| 40 | + null, null, |
| 41 | + "attribute.constants.target-property", |
| 42 | + "class.attribute", |
| 43 | + "", "", "", "", "", "", 0, |
| 44 | +); |
| 45 | + |
| 46 | +$render = new TestRender(new Reader($outputHandler), $config, $format); |
| 47 | + |
| 48 | +$render->run(); |
| 49 | +?> |
| 50 | +--EXPECT-- |
| 51 | +Filename: attribute-formatting-006.html |
| 52 | +Content: |
| 53 | +<div id="attribute-formatting-006" class="chapter"> |
| 54 | + <div class="section"> |
| 55 | + <p class="para">1. methodparam with unknown attribute</p> |
| 56 | + <div class="methodsynopsis dc-description"><span class="type">void</span> <span class="methodname">example1</span>(<span class="methodparam"><span class="attribute">#[\UnknownAttribute]</span><span class="type">string</span> <code class="parameter">$password</code></span>)</div> |
| 57 | + |
| 58 | + </div> |
| 59 | + |
| 60 | + <div class="section"> |
| 61 | + <p class="para">2. methodparam with known attribute</p> |
| 62 | + <div class="methodsynopsis dc-description"><span class="type">void</span> <span class="methodname">example2</span>(<span class="methodparam"><span class="attribute"><a href="class.sensitiveparameter.html">#[\SensitiveParameter]</a> </span><span class="type">string</span> <code class="parameter">$password</code></span>)</div> |
| 63 | + |
| 64 | + </div> |
| 65 | + |
| 66 | + <div class="section"> |
| 67 | + <p class="para">3. methodparam with attribute with named args (rendered inline)</p> |
| 68 | + <div class="methodsynopsis dc-description"><span class="type">void</span> <span class="methodname">example3</span>(<span class="methodparam"><span class="attribute">#[<a href="class.deprecated.html">\Deprecated</a>(<br> <code class="parameter">since</code>: <span class="type string">'8.5'</span>,<br> <code class="parameter">message</code>: <span class="type string">'Use foo()'</span>,<br>)]</span><span class="type">string</span> <code class="parameter">$password</code></span>)</div> |
| 69 | + |
| 70 | + </div> |
| 71 | + |
| 72 | + <div class="section"> |
| 73 | + <p class="para">4. methodparam with attribute with single constant arg</p> |
| 74 | + <div class="methodsynopsis dc-description"><span class="type">void</span> <span class="methodname">example4</span>(<span class="methodparam"><span class="attribute">#[<a href="class.attribute.html">\Attribute</a>(<a href="class.attribute.html#attribute.constants.target-parameter">Attribute::TARGET_PARAMETER</a>)]</span><span class="type">string</span> <code class="parameter">$password</code></span>)</div> |
| 75 | + |
| 76 | + </div> |
| 77 | + |
| 78 | + <div class="section"> |
| 79 | + <p class="para">5. methodparam with attribute with pipe-separated constants (rendered inline)</p> |
| 80 | + <div class="methodsynopsis dc-description"><span class="type">void</span> <span class="methodname">example5</span>(<span class="methodparam"><span class="attribute">#[<a href="class.attribute.html">\Attribute</a>(<br> <a href="class.attribute.html#attribute.constants.target-parameter">Attribute::TARGET_PARAMETER</a><br> | <a href="class.attribute.html#attribute.constants.target-property">Attribute::TARGET_PROPERTY</a>,<br>)]</span><span class="type">string</span> <code class="parameter">$password</code></span>)</div> |
| 81 | + |
| 82 | + </div> |
| 83 | + |
| 84 | + <div class="section"> |
| 85 | + <p class="para">6. methodparam with attribute with literal args (rendered inline)</p> |
| 86 | + <div class="methodsynopsis dc-description"><span class="type">void</span> <span class="methodname">example6</span>(<span class="methodparam"><span class="attribute">#[\UnknownAttribute(<br> <code class="parameter">enabled</code>: <span class="type true">true</span>,<br> <code class="parameter">default</code>: <span class="type null">null</span>,<br> <code class="parameter">count</code>: <span class="type int">42</span>,<br> <code class="parameter">ratio</code>: <span class="type float">3.14</span>,<br>)]</span><span class="type">string</span> <code class="parameter">$password</code></span>)</div> |
| 87 | + |
| 88 | + </div> |
| 89 | + |
| 90 | + <div class="section"> |
| 91 | + <p class="para">7. methodparam with multiple attributes</p> |
| 92 | + <div class="methodsynopsis dc-description"><span class="type">void</span> <span class="methodname">example7</span>(<span class="methodparam"><span class="attribute"><a href="class.sensitiveparameter.html">#[\SensitiveParameter]</a> </span><span class="attribute">#[<a href="class.deprecated.html">\Deprecated</a>(<code class="parameter">since</code>: <span class="type string">'8.5'</span>)]</span><span class="type">string</span> <code class="parameter">$password</code></span>)</div> |
| 93 | + |
| 94 | + </div> |
| 95 | +</div> |
0 commit comments