-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
53 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
const __ROOT__ = __DIR__; | ||
|
||
require_once __ROOT__.'/vendor/autoload.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BBO\Faucet\Tests\Integration; | ||
|
||
use BBO\Faucet\DI\Faucet; | ||
use Nyholm\Psr7\ServerRequest; | ||
use PHPUnit\Framework\TestCase; | ||
use Slim\App; | ||
use UMA\DIC\Container; | ||
|
||
final class WebTest extends TestCase | ||
{ | ||
private App $sut; | ||
|
||
protected function setUp(): void | ||
{ | ||
$container = new Container(); | ||
$container->register(new Faucet()); | ||
|
||
$this->sut = $container->get(Faucet::class); | ||
} | ||
|
||
public function testLandingPage(): void | ||
{ | ||
$res = $this->sut->handle(new ServerRequest('GET', '/')); | ||
|
||
self::assertSame(200, $res->getStatusCode()); | ||
self::assertStringContainsString('<title>Testing Faucet</title>', (string) $res->getBody()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters