Skip to content

Commit

Permalink
✅ added test for #158, looks like default behaviour works as expected…
Browse files Browse the repository at this point in the history
…. Test needs extending.
  • Loading branch information
Simon Dann committed Apr 18, 2017
1 parent ddcdb21 commit d722bff
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 1 deletion.
30 changes: 29 additions & 1 deletion tests/BuildCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public function testBlogPostBuild()
}

/**
* Written for issuer #152
* Written for issue #152
* @link https://github.com/carbontwelve/tapestry/issues/152
*/
public function testIgnoreUnderscorePaths()
Expand All @@ -279,4 +279,32 @@ public function testIgnoreUnderscorePaths()
$this->assertFileExists(__DIR__ . '/_tmp/build_local/should-exist/index.html');
$this->assertFileNotExists(__DIR__ . '/_tmp/build_local/should-exist/_should-not-exist/index.html');
}

/**
* Written for issue #158
* @link https://github.com/carbontwelve/tapestry/issues/158
*/
public function testFileTemplatePassthrough()
{
$this->copyDirectory('assets/build_test_31/src', '_tmp');

$output = $this->runCommand('build', '--quiet');

$this->assertEquals('', trim($output->getDisplay()));
$this->assertEquals(0, $output->getStatusCode());

$this->assertFileEquals(
__DIR__.'/assets/build_test_31/check/single.html',
__DIR__.'/_tmp/build_local/single/index.html',
'',
true
);

$this->assertFileEquals(
__DIR__.'/assets/build_test_31/check/base.html',
__DIR__.'/_tmp/build_local/base/index.html',
'',
true
);
}
}
6 changes: 6 additions & 0 deletions tests/assets/build_test_31/check/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
!!! default.phtml
base_phtml
!!! ./default.phtml
!!! base.phtml
base_phtml
!!! ./base.phtml
3 changes: 3 additions & 0 deletions tests/assets/build_test_31/check/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
!!! single.phtml
single_phtml
!!! ./single.phtml
5 changes: 5 additions & 0 deletions tests/assets/build_test_31/src/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'debug' => false
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
!!! default.phtml
<?= (is_null($this->getFile()) ? 'null' : $this->getFile()->getUid()) . "\n" ?>
!!! ./default.phtml
<?= $this->section('content') ?>
6 changes: 6 additions & 0 deletions tests/assets/build_test_31/src/source/base.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
layout: default
---
!!! base.phtml
<?= (is_null($this->getFile()) ? 'null' : $this->getFile()->getUid()) . "\n" ?>
!!! ./base.phtml
3 changes: 3 additions & 0 deletions tests/assets/build_test_31/src/source/single.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
!!! single.phtml
<?= (is_null($this->getFile()) ? 'null' : $this->getFile()->getUid()) . "\n" ?>
!!! ./single.phtml

0 comments on commit d722bff

Please sign in to comment.