Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yeah, the output of assertTag() stinks.</p> <p>I would recommend breaking this out into multiple assertions and/or tests. I think the reason you're getting an error is that it's getting confused on the <strong><code>'count' =&gt; 4</code></strong> line.</p> <p>A good technique, I've found, is to build up the <code>$matcher</code> array gradually, and when you get an error, that's the problem point. Conversely, you can write the whole thing, then comment it all out and remove comments gradually.</p> <p>When that particular line is commented, the assertion succeeds. When it's not commented, I get the same error you do.</p> <p>Here's the weird part: If you put in a value <em>other</em> than 4, such as 5, you get a <em>different</em> error:</p> <p><code>Invalid argument supplied for foreach()</code></p> <p>I think it might be getting confused because you are counting children of children (grandchildren, if you will) when the children count is <em>itself</em> > 1. I tried using a value of "8" because technically your HTML contains <em>8</em> td's that are children of tr's, but that gave the foreach() error shown.</p> <p>Suggestions:</p> <ol> <li><p>Break out into multiple assertions and/or tests. Possibly a separate regex-based assertion to confirm the <em>counts</em> of the various elements and the hierarchy? </p></li> <li><p>Tip, more than a suggestion: it's not necessary to do </p> <pre><code>'attributes' =&gt; array('id' =&gt; 'peopleLarge'), </code></pre> <p>Instead, you can just do:</p> <pre><code>'id' =&gt; 'peopleLarge', </code></pre> <p>(ID is itself a criteria for assertTag())</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload