PMCORE-593 Action by email: when the authentication is incorrect we can see an error in the routing page.

This commit is contained in:
Roly Rudy Gutierrez Pinto
2020-06-09 12:50:12 -04:00
parent 19c4a93f33
commit 683c69ba81
8 changed files with 925 additions and 200 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,86 @@
<?php
use Tests\TestCase;
class WsResponseTest extends TestCase
{
private $wsResponse;
/**
* Set up method.
*/
public function setUp()
{
parent::setUp();
}
/**
* This test get a extra param.
* @test
* @covers \WsResponse::__construct
* @covers \WsResponse::getExtraParam
*/
public function it_should_test_get_extra_param()
{
$this->wsResponse = new WsResponse(0, '');
//assert
$actual = $this->wsResponse->getExtraParam('');
$this->assertEmpty($actual);
//assert
$actual = $this->wsResponse->getExtraParam('test');
$this->assertEmpty($actual);
//assert
$expected = 'test';
$this->wsResponse->addExtraParam('test', $expected);
$actual = $this->wsResponse->getExtraParam('test');
$this->assertEquals($expected, $actual);
}
/**
* This test the add extra param.
* @test
* @covers \WsResponse::addExtraParam
*/
public function it_should_test_add_extra_param()
{
$this->wsResponse = new WsResponse(0, '');
//assert
$expected = 'test';
$this->wsResponse->addExtraParam('test', $expected);
$actual = $this->wsResponse->getExtraParam('test');
$this->assertEquals($expected, $actual);
}
/**
* This test a get payload string.
* @test
* @covers \WsResponse::getPayloadString
*/
public function it_should_test_get_payload_string()
{
$this->wsResponse = new WsResponse(0, '');
//assert
$actual = $this->wsResponse->getPayloadString('test');
$this->assertContains('test', $actual);
}
/**
* @test
* @covers \WsResponse::getPayloadArray
*/
public function it_should_test_payload_array()
{
$this->wsResponse = new WsResponse(0, '');
//assert
$actual = $this->wsResponse->getPayloadArray();
$this->assertArrayHasKey('status_code', $actual);
$this->assertArrayHasKey('message', $actual);
$this->assertArrayHasKey('timestamp', $actual);
}
}