deployer/tests/e2e/LaravelBoilerplateE2ETest.php
Sacharski Bartłomiej 165ffa119a
Implemented ConsoleApplicationTester for isolated E2E tests (#2513)
Added a new class ConsoleApplicationTester, which during E2E tests
will create a separate isolated process for the Deployer to run in.

This class exposes methods for interacting with stdin and to grab
stdout, stderr and status code of finished process.
2021-04-17 23:11:26 +03:00

38 lines
990 B
PHP

<?php declare(strict_types=1);
namespace e2e;
class LaravelBoilerplateE2ETest extends AbstractE2ETest
{
private const RECIPE = __DIR__ . '/recipe/laravel-boilerplate.php';
public function testDeployLaravelBoilerplate(): void
{
$this->tester->setTimeout(180)
->run([
'-f' => self::RECIPE,
'deploy',
'all',
]);
$display = trim($this->tester->getDisplay());
self::assertEquals(0, $this->tester->getStatusCode(), $display);
$siteContent = file_get_contents('http://server.test');
$expectedSiteContent = "Build v8.";
self::assertStringContainsString($expectedSiteContent, $siteContent);
}
protected function tearDown(): void
{
parent::tearDown();
if ($this->tester) {
$this->tester->run([
'-f' => self::RECIPE,
'deploy:unlock',
'all',
]);
}
}
}