2024-05-06 13:19:09 -05:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2024-05-01 15:03:43 -05:00
|
|
|
|
2024-05-06 13:19:09 -05:00
|
|
|
define('PD', 'D:\DEV\Git Repository\CustomerRewardsRESTAPI');
|
|
|
|
require_once PD . "/Controller/API/BaseController.php";
|
2024-05-01 15:03:43 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Description of BaseControllerTest
|
|
|
|
*
|
|
|
|
* @author SCTN4
|
|
|
|
*/
|
2024-05-06 13:19:09 -05:00
|
|
|
class BaseControllerTest extends TestCase {
|
2024-05-01 15:03:43 -05:00
|
|
|
|
2024-05-06 13:19:09 -05:00
|
|
|
protected $base;
|
|
|
|
|
|
|
|
#[\Override]
|
|
|
|
public function setUp(): void {
|
|
|
|
$this->base = new BaseController();
|
2024-05-01 15:03:43 -05:00
|
|
|
}
|
|
|
|
|
2024-05-06 13:19:09 -05:00
|
|
|
#[\Override]
|
|
|
|
public function tearDown(): void {
|
|
|
|
$this->base = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testConstruct(): void
|
|
|
|
{
|
|
|
|
$this->assertSame('BaseController', $this->base->name);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testCreate(): void
|
|
|
|
{
|
|
|
|
$controllerObj = BaseController::create();
|
|
|
|
$this->assertSame('BaseController', $controllerObj->name);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[Depends('testConstruct')]
|
|
|
|
public function testCall(): void
|
|
|
|
{
|
|
|
|
$this->base->mymethod = 'test';
|
|
|
|
$this->assertSame('test', $this->base->mymethod);
|
2024-05-01 15:03:43 -05:00
|
|
|
}
|
|
|
|
|
2024-05-06 13:19:09 -05:00
|
|
|
public function testGetUriSegments(): void
|
|
|
|
{
|
|
|
|
// Stop here and mark this test as incomplete.
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
'This test has not been implemented yet.',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetQueryStringParams(): void
|
|
|
|
{
|
|
|
|
// Stop here and mark this test as incomplete.
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
'This test has not been implemented yet.',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetServerRequestMethod(): void
|
|
|
|
{
|
|
|
|
// Stop here and mark this test as incomplete.
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
'This test has not been implemented yet.',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testSendOutput(): void
|
|
|
|
{
|
|
|
|
// Stop here and mark this test as incomplete.
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
'This test has not been implemented yet.',
|
|
|
|
);
|
2024-05-01 15:03:43 -05:00
|
|
|
}
|
2024-05-06 13:19:09 -05:00
|
|
|
|
2024-05-01 15:03:43 -05:00
|
|
|
}
|