Skip to content

Commit

Permalink
Update KumbiaTestTrait
Browse files Browse the repository at this point in the history
  • Loading branch information
joanhey committed Mar 14, 2018
1 parent af65a45 commit 51edfb5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion default/app/phpunit.xml.dist
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors="true"
processIsolation="false"
processIsolation="true"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./tests/bootstrap.php"
Expand Down
47 changes: 26 additions & 21 deletions default/app/tests/KumbiaTestTrait.php
Expand Up @@ -21,28 +21,28 @@
trait KumbiaTestTrait
{
/**
* Asserts HTTP response code
*
* @param int $code
*/
public function assertResponseCode($code)
{
$actual = http_response_code();
$this->assertSame(
$code,
$actual,
"Status code is not $code but $actual."
);
* Asserts HTTP response code
*
* @param int $code
*/
public function assertResponseCode($code)
{
$actual = http_response_code();
$this->assertSame(
$code,
$actual,
"Status code is not $code but $actual."
);
}
/**
* Request to Controller
*
* @param string $method HTTP method
* @param string $url array of controller,method,arg|uri
* @param array $params POST parameters/Query string
*/
protected function request($method, $url, $params = [])
{
* Request to Controller
*
* @param string $method HTTP method
* @param string $url controller/method/arg|uri
* @param array $params POST parameters/Query string
*/
protected function request($method, $url, $params = [])
{
$_SERVER['REQUEST_METHOD'] = $method;

ob_start();
Expand All @@ -56,7 +56,12 @@ protected function request($method, $url, $params = [])
//$content = $this->getActualOutput();
return ob_get_clean();
}

/**
* GET Request to Controller
*
* @param string $url controller/method/arg|uri
* @param array $params Query string
*/
public function get($url, $params = [])
{
return $this->request('GET', $url, $params);
Expand Down

0 comments on commit 51edfb5

Please sign in to comment.