-
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.
Merge pull request #25 from rawsrc/6.1.0
6.1.0
- Loading branch information
Showing
16 changed files
with
2,149 additions
and
837 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -460,4 +460,4 @@ | |
</body> | ||
</html> | ||
html); | ||
html); |
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,53 @@ | ||
<?php declare(strict_types=1); | ||
|
||
use Exacodis\Pilot; | ||
use rawsrc\PhpEcho\PhpEcho; | ||
|
||
/** @var Pilot $pilot */ | ||
|
||
$layout = new PhpEcho(file: 'layout_02.php', id: 'root'); | ||
|
||
$a = new PhpEcho(id: 'a'); | ||
$a->setCode('<p>Block a</p>'); | ||
|
||
$b = new PhpEcho(id: 'b'); | ||
$b->setCode('<p>Block b</p>'); | ||
|
||
|
||
$layout['a'] = $a; | ||
$layout['b'] = $b; | ||
|
||
$layout['block_01'] = $layout['a']; | ||
$layout['block_02'] = $layout['a']; | ||
|
||
ob_start(); | ||
echo $layout; | ||
$html = ob_get_clean(); | ||
|
||
$pilot->run( | ||
id: 'infinite_loop_01', | ||
test: fn() => $html, | ||
description: 'multiple usage of the same block, no infinite loop' | ||
); | ||
$pilot->assertIsString(); | ||
$pilot->assertEqual(<<<html | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
</head> | ||
<body> | ||
<p>Block a</p><p>Block a</p></body> | ||
</html> | ||
html); | ||
|
||
|
||
$layout = new PhpEcho(file: 'layout_07.php', id: 'root'); | ||
$layout['block'] = new PhpEcho(file: 'block/block_07.php'); | ||
|
||
$pilot->run( | ||
id: 'infinite_loop_02', | ||
test: fn() => (string)$layout, | ||
description: 'infinite loop, block calling each others' | ||
); | ||
$pilot->assertException(InvalidArgumentException::class); |
Oops, something went wrong.