title: How to seeResponseContainsJson two levels deep with Codeception?
body: <p>I am new to Codeception and I am trying to test my web service using the same. Right now I am trying to figure out how to dig deep and test the output that comes from different API points. For example, I am trying to create a user and check if the response contains the necessary details.</p>
  
  <p><strong>CreateUserCept.php</strong></p>
  
  <pre><code>&lt;?php 
  $faker = Faker\Factory::create();
  $I = new ApiTester($scenario);
  $I-&gt;wantTo('create a new user');
  $I-&gt;haveHttpHeader('Authorization', 'Bearer ' . file_get_contents('tests/api/token'));
  $I-&gt;sendPost('users', [
      "first_name"    =&gt; "Test",
      "last_name"     =&gt; "Test",
      "email"         =&gt; 'test@test.com',
      "password"      =&gt; "testing",
      "role"          =&gt; "1"
  ]);
  $I-&gt;seeResponseCodeIs(200);
  $I-&gt;seeResponseIsJson();
  </code></pre>
  
  <p>The response looks something like:</p>
  
  <pre><code>{
    "status": "success",
    "data": {
      "first_name": "Test",
      "last_name": "Test",
      "email": "test@test.com",
      "updated_at": "2015-11-12 09:08:31",
      "created_at": "2015-11-12 09:08:31",
      "id": 54
    },
    "errors": null,
    "message": "Resource Created Successfully"
  }
  </code></pre>
  
  <p>Now I can do assertions like:</p>
  
  <pre><code>$I-&gt;seeResponseContainsJson(['status' =&gt; 'success']);
  </code></pre>
  
  <p>And it works like a charm but when I do this:</p>
  
  <pre><code>$I-&gt;seeResponseContainsJson(['data.first_name' =&gt; 'Test']);
  </code></pre>
  
  <p>It fails. What is the correct way to dig into these and check the JSON response is correct?</p>