-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed programatically loading a pattern with custom data.
- Loading branch information
Tom Hewitt
committed
Jun 20, 2016
1 parent
e534552
commit 98209c3
Showing
4 changed files
with
34 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace Rareloop\Primer\Tests; | ||
|
||
use Rareloop\Primer\Primer; | ||
use Rareloop\Primer\Renderable\Pattern; | ||
use Rareloop\Primer\TemplateEngine\Handlebars\Template as HandlebarsTemplateEngine; | ||
|
||
class PatternTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
protected $primer; | ||
|
||
public function testCustomPatternData() | ||
{ | ||
$primer = Primer::start(array( | ||
'basePath' => __DIR__.'/primer-test', | ||
'templateClass' => HandlebarsTemplateEngine::class, | ||
)); | ||
|
||
$pattern = new Pattern('components/patterns/custom-data', [ | ||
'name' => 'Test name', | ||
]); | ||
|
||
$output = $pattern->render(false); | ||
$this->assertEquals("Test name", $output); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
tests/primer-test/patterns/components/patterns/custom-data/template.hbs
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 @@ | ||
{{ name }} |