2026-01-04 18:16:27 +01:00
|
|
|
<?php
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
|
|
|
|
|
class IndexTest extends TestCase
|
|
|
|
|
{
|
|
|
|
|
public function testHello(): void
|
|
|
|
|
{
|
|
|
|
|
$_GET['name'] = 'Poopiebutt';
|
|
|
|
|
|
|
|
|
|
ob_start();
|
|
|
|
|
include 'index.php';
|
|
|
|
|
$content = ob_get_clean();
|
|
|
|
|
|
|
|
|
|
$this->assertEquals('Hello Poopiebutt', $content);
|
|
|
|
|
}
|
2026-01-04 20:15:05 +01:00
|
|
|
|
|
|
|
|
public function testHelloNoParam(): void
|
|
|
|
|
{
|
|
|
|
|
unset($_GET['name']);
|
|
|
|
|
ob_start();
|
|
|
|
|
include 'index.php';
|
|
|
|
|
$content = ob_get_clean();
|
|
|
|
|
|
|
|
|
|
$this->assertEquals('Hello Dingo', $content);
|
|
|
|
|
}
|
2026-01-04 18:16:27 +01:00
|
|
|
}
|
|
|
|
|
|