Skip to content

Commit

Permalink
Unit Test / ObjectTest fix (not all php versions support empty string…
Browse files Browse the repository at this point in the history
… property name or nul within name)
  • Loading branch information
bkdotcom committed Sep 5, 2023
1 parent bd64918 commit 78c97df
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/Debug/Type/ObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ public static function providerTestMethod()
(object) array(
"\xE2\x80\x8B" => 'zwsp',
"\xef\xbb\xbf" => 'bom',
"\xef\xbb\xbfbom\r\n\t\x07 \x1F \x7F \x00 \xc2\xa0<i>(nbsp)</i> \xE2\x80\x89(thsp), & \xE2\x80\x8B(zwsp)" => 'ctrl chars and whatnot',
"\xef\xbb\xbfbom\r\n\t\x07 \x1F \x7F \xc2\xa0<i>(nbsp)</i> \xE2\x80\x89(thsp), & \xE2\x80\x8B(zwsp)" => 'ctrl chars and whatnot',
' ' => 'space',
'' => 'empty',
),
Expand All @@ -610,23 +610,23 @@ public static function providerTestMethod()
'html' => '<li class="m_log"><div class="t_object" data-accessible="public"><span class="classname">stdClass</span>
<dl class="object-inner">
%A<dt class="properties">properties</dt>
<dd class="property public"><span class="t_modifier_public">public</span> <span class="t_identifier t_string"></span> <span class="t_operator">=</span> <span class="t_string">empty</span></dd>
<dd class="property public"><span class="t_modifier_public">public</span> <span class="t_identifier t_string"> </span> <span class="t_operator">=</span> <span class="t_string">space</span></dd>
' . (PHP_VERSION_ID >= 70100 ? '<dd class="property public"><span class="t_modifier_public">public</span> <span class="t_identifier t_string"></span> <span class="t_operator">=</span> <span class="t_string">empty</span></dd>' . "\n" : '')
. '<dd class="property public"><span class="t_modifier_public">public</span> <span class="t_identifier t_string"> </span> <span class="t_operator">=</span> <span class="t_string">space</span></dd>
<dd class="property public"><span class="t_modifier_public">public</span> <span class="no-quotes t_identifier t_string"><a class="unicode" href="https://unicode-table.com/en/200b" target="unicode-table" title="Zero Width Space: \xe2 \x80 \x8b">\u200b</a></span> <span class="t_operator">=</span> <span class="t_string">zwsp</span></dd>
<dd class="property public"><span class="t_modifier_public">public</span> <span class="no-quotes t_identifier t_string"><a class="unicode" href="https://unicode-table.com/en/feff" target="unicode-table" title="BOM / Zero Width No-Break Space: \xef \xbb \xbf">\ufeff</a></span> <span class="t_operator">=</span> <span class="t_string">bom</span></dd>
<dd class="property public"><span class="t_modifier_public">public</span> <span class="t_identifier t_string"><a class="unicode" href="https://unicode-table.com/en/feff" target="unicode-table" title="BOM / Zero Width No-Break Space: \xef \xbb \xbf">\ufeff</a>bom<span class="ws_r"></span><span class="ws_n"></span>
<span class="ws_t">%s</span><span class="binary"><span class="c1-control" title="BEL (bell): \x07">␇</span></span> <span class="binary"><span class="c1-control" title="US (unit seperator): \x1f">␟</span></span> <span class="binary"><span class="c1-control" title="DEL: \x7f">␡</span></span> <span class="binary"><span class="c1-control" title="NUL: \x00">␀</span></span> <a class="unicode" href="https://unicode-table.com/en/00a0" target="unicode-table" title="NBSP: \xc2 \xa0">\u00a0</a>&lt;i&gt;(nbsp)&lt;/i&gt; <a class="unicode" href="https://unicode-table.com/en/2009" target="unicode-table" title="Thin Space: \xe2 \x80 \x89">\u2009</a>(thsp), &amp; <a class="unicode" href="https://unicode-table.com/en/200b" target="unicode-table" title="Zero Width Space: \xe2 \x80 \x8b">\u200b</a>(zwsp)</span> <span class="t_operator">=</span> <span class="t_string">ctrl chars and whatnot</span></dd>
<span class="ws_t">%s</span><span class="binary"><span class="c1-control" title="BEL (bell): \x07">␇</span></span> <span class="binary"><span class="c1-control" title="US (unit seperator): \x1f">␟</span></span> <span class="binary"><span class="c1-control" title="DEL: \x7f">␡</span></span> <a class="unicode" href="https://unicode-table.com/en/00a0" target="unicode-table" title="NBSP: \xc2 \xa0">\u00a0</a>&lt;i&gt;(nbsp)&lt;/i&gt; <a class="unicode" href="https://unicode-table.com/en/2009" target="unicode-table" title="Thin Space: \xe2 \x80 \x89">\u2009</a>(thsp), &amp; <a class="unicode" href="https://unicode-table.com/en/200b" target="unicode-table" title="Zero Width Space: \xe2 \x80 \x8b">\u200b</a>(zwsp)</span> <span class="t_operator">=</span> <span class="t_string">ctrl chars and whatnot</span></dd>
%A</dl>
</div></li>',
'script' => 'console.log({"___class_name":"stdClass","(public) ":"empty","(public) ":"space","(public) \\\u{200b}":"zwsp","(public) \\\u{feff}":"bom","(public) \\\u{feff}bom\r\n\t\\\x07 \\\x1f \\\x7f \\\x00 \\\u{00a0}<i>(nbsp)</i> \\\u{2009}(thsp), & \\\u{200b}(zwsp)":"ctrl chars and whatnot"});',
'script' => 'console.log({"___class_name":"stdClass",' . (PHP_VERSION_ID >= 70100 ? '"(public) ":"empty",' : '') . '"(public) ":"space","(public) \\\u{200b}":"zwsp","(public) \\\u{feff}":"bom","(public) \\\u{feff}bom\r\n\t\\\x07 \\\x1f \\\x7f \\\u{00a0}<i>(nbsp)</i> \\\u{2009}(thsp), & \\\u{200b}(zwsp)":"ctrl chars and whatnot"});',
'text' => 'stdClass
Properties:
(public) "" = "empty"
(public) " " = "space"
' . (PHP_VERSION_ID >= 70100 ? '(public) "" = "empty"' . "\n" : '')
. '(public) " " = "space"
(public) \u{200b} = "zwsp"
(public) \u{feff} = "bom"
(public) "\u{feff}bom%A
%A\x07 \x1f \x7f \x00 \u{00a0}<i>(nbsp)</i> \u{2009}(thsp), & \u{200b}(zwsp)" = "ctrl chars and whatnot"
%A\x07 \x1f \x7f \u{00a0}<i>(nbsp)</i> \u{2009}(thsp), & \u{200b}(zwsp)" = "ctrl chars and whatnot"
Methods: none!',
),
),
Expand Down

0 comments on commit 78c97df

Please sign in to comment.