public function testGrabDataFromJsonResponse() { $this->module->sendGET('/rest/user/'); // simple assoc array $this->assertEquals('*****@*****.**', $this->module->grabDataFromJsonResponse('email')); // nested assoc array $this->assertEquals('Kyiv', $this->module->grabDataFromJsonResponse('address.city')); // nested index array $this->assertEquals('DavertMik', $this->module->grabDataFromJsonResponse('aliases.0')); // fail if data not found $this->setExpectedException('PHPUnit_Framework_AssertionFailedError', 'Response does not have required data'); $this->module->grabDataFromJsonResponse('address.street'); }