title: How to test inner arrays with phpunit
body: <p>I have to test an array with inner arrays.</p>
  
  <p>my array looks like the following.</p>
  
  <pre><code>$testdata=Array
      (
          [0] =&gt; Array
              (
                  [label] =&gt; 'Ammy'
                  [idr] =&gt; 'user7'
                  [rel] =&gt; 7
              )
  
          [1] =&gt; Array
              (
                  [label] =&gt; 'sidh'
                  [idr] =&gt; user8
                  [rel] =&gt; 8
              )
  
          [2] =&gt; Array
              (
                  [label] =&gt; 'Alan'
                  [idr] =&gt; 'user9'
                  [rel] =&gt; 9
              )
      )
  </code></pre>
  
  <p>in this case my requirement is to assert whether the keys for inner array present using assertArrayHasKey() assertion of phpunit. I tried to do it like this</p>
  
  <pre><code>foreach ($testdata as $values) {
   //print_r($values);
    $this-&gt;assertArrayHasKey('idr', $values);
    $this-&gt;assertArrayHasKey('rel', $values);
  
  }
  </code></pre>
  
  <p>but this is not working for me. even the control does not go inside the foreach() loop.</p>
  
  <p>please suggest me some solution for this.</p>