oauth2-server/tests/_support/AuthHelper.php

22 lines
608 B
PHP
Raw Normal View History

2014-07-28 03:21:00 +05:30
<?php
namespace Codeception\Module;
// here you can define custom actions
// all public methods declared in helper class will be available in $I
class AuthHelper extends \Codeception\Module
{
function seeJsonKeyExists($key)
{
$json = $this->getModule('REST')->grabResponse();
$array = json_decode($json);
$this->assertTrue(array_key_exists($key, $array));
}
function seeJsonKeyDoesNotExists($key)
{
$json = $this->getModule('REST')->grabResponse();
$array = json_decode($json);
$this->assertFalse(array_key_exists($key, $array));
}
}