Skip to content

Commit

Permalink
Minor update: change the visibility of $data in the class `ViewBuil…
Browse files Browse the repository at this point in the history
…der`

Test files update
  • Loading branch information
rawsrc committed May 9, 2023
1 parent 1249773 commit 6a8fd30
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

use Exacodis\Pilot;

$pilot = new Pilot('PhpEcho - A native PHP template engine - v.5.4.1');
$pilot = new Pilot('PhpEcho - A native PHP template engine - v.5.4.2');
$pilot->injectStandardHelpers();

include 'filepath.php';
Expand Down
18 changes: 18 additions & 0 deletions tests/viewBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,21 @@ public function build(): PhpEcho
</body>
</html>
html);

$login->data['xyz'] = 'bar002';
$pilot->run(
id: 'view.builder.004',
test: fn() => $login->data['xyz'],
description: 'public access to the ViewBuilder data array'
);
$pilot->assertIsString();
$pilot->assertEqual('bar002');

$pilot->run(
id: 'view.builder.005',
test: fn() => $login->getData()['xyz'] === 'bar002',
description: 'view builder, share data with ArrayAccess and public visibility'
);
$pilot->assertIsBool();
$pilot->assertEqual(true);

0 comments on commit 6a8fd30

Please sign in to comment.