jeudi 26 novembre 2015

Access array value from codeception object

I am on PHP53 so codeception 1.8

$response = (array)$I->grabDataFromJsonResponse("result");
\Codeception\Util\Debug::debug($response);

  Array
  (
      [*position] => 0
      [*val] => Array
          (
              [key1] => 10
              [key2] => 1
          )

      [*assocArray] => 1
  )

Now when I try to access the values in the array it gives me error

\Codeception\Util\Debug::debug($response['key1']);

[ErrorException] Undefined index: key1

Aucun commentaire:

Enregistrer un commentaire