Skip to content

Commit a5f7165

Browse files
authored
Allow empty index (#6)
* Declare properties private * Allow setting an empty index
1 parent cb6164c commit a5f7165

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Codeception/Lib/Connector/Universal.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ final class Universal extends Client
88
{
99
use Shared\PhpSuperGlobalsConverter;
1010

11-
protected ?object $mockedResponse = null;
12-
protected ?string $index = null;
11+
private ?object $mockedResponse = null;
12+
private string $index = '';
1313

1414
public function setIndex(string $index): void
1515
{
@@ -46,7 +46,9 @@ public function doRequest(object $request): object
4646
$_SERVER['REQUEST_URI'] = $uri;
4747

4848
ob_start();
49-
include $this->index;
49+
if ('' !== $this->index) {
50+
include $this->index;
51+
}
5052

5153
$content = ob_get_contents();
5254
ob_end_clean();

0 commit comments

Comments
 (0)