41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
require_once __DIR__ . '/helper/TestResultsManager.php';
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class ProsesFormRequiredTest extends TestCase
|
|
{
|
|
private $testResultsManager;
|
|
|
|
protected function setUp(): void
|
|
{
|
|
$this->testResultsManager = new TestResultsManager();
|
|
}
|
|
|
|
public function testSuccessfulSubmission()
|
|
{
|
|
try {
|
|
$testCase = get_class($this) . '.' . __FUNCTION__;
|
|
|
|
$_GET['yourname'] = 'AliyyaPS';
|
|
$_GET['youraddress'] = 'Sidoarjo';
|
|
|
|
ob_start();
|
|
|
|
include_once './apps/prosesFormRequired.php';
|
|
|
|
$output = ob_get_clean();
|
|
|
|
$dom = new DOMDocument();
|
|
$dom->loadHTML($output);
|
|
|
|
$this->assertStringContainsString('Your Name: AliyyaPS', $dom->textContent);
|
|
$this->assertStringContainsString('Your Address: Sidoarjo', $dom->textContent);
|
|
$this->testResultsManager->showTestResult($testCase);
|
|
} catch (\Throwable $e) {
|
|
$this->testResultsManager->showTestResult($testCase, $e);
|
|
throw $e;
|
|
}
|
|
}
|
|
}
|