Skip to content

Commit

Permalink
Returning Instead Of Breaking - Stop Processing Additional View Direc…
Browse files Browse the repository at this point in the history
…tories - Automated Testing
  • Loading branch information
Fenikkusu authored and niden committed Nov 12, 2019
1 parent 7e38f82 commit 6cc7a4a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/_data/fixtures/views-alt/simple/params.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
/**
* @var string $name
* @var int $age
*/
echo "My name is $name and I am not $age years old";
30 changes: 30 additions & 0 deletions tests/integration/Mvc/View/RenderCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,34 @@ public function shouldRenderWithParams(IntegrationTester $I)
$view->getContent()
);
}

public function doesNotRenderMultiple(IntegrationTester $I)
{
$view = new View();

$view->setViewsDir(
[
dataDir('fixtures/views'),
dataDir('fixtures/views-alt')
]
);

$view->start();

$view->render(
'simple',
'params',
[
'name' => 'Sam',
'age' => 20,
]
);

$view->finish();

$I->assertEquals(
'My name is Sam and I am 20 years old',
$view->getContent()
);
}
}

0 comments on commit 6cc7a4a

Please sign in to comment.