-
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump Smarty and add simple happy path test
- Loading branch information
Showing
6 changed files
with
112 additions
and
52 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/** | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* This software consists of voluntary contributions made by many individuals | ||
* and is licensed under the LGPL. For more information please see | ||
* <http://phing.info>. | ||
*/ | ||
|
||
namespace Phing\Test\Task\Ext\Smarty; | ||
|
||
use Phing\Test\Support\BuildFileTest; | ||
|
||
class SmartyTaskTest extends BuildFileTest | ||
{ | ||
protected function setUp(): void | ||
{ | ||
$buildXmlFile = PHING_TEST_BASE . '/etc/tasks/ext/smarty/SmartyTaskTest.xml'; | ||
$this->configureProject($buildXmlFile); | ||
$this->executeTarget('setup'); | ||
} | ||
|
||
public function tearDown(): void | ||
{ | ||
$this->executeTarget('clean'); | ||
} | ||
|
||
public function testRenderSimpleTemplate(): void | ||
{ | ||
$this->executeTarget(__FUNCTION__); | ||
$this->assertStringEqualsFile(PHING_TEST_BASE . "/etc/tasks/ext/smarty/tmp/test.txt", "Foo\n"); | ||
} | ||
} |
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,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project name="smarty-test" default="invalid"> | ||
<target name="invalid"> | ||
<fail>This file should only be run via a testcase.</fail> | ||
</target> | ||
|
||
<property name="tmp.dir" value="tmp"/> | ||
<resolvepath propertyName="tmp.dir.resolved" file="${tmp.dir}"/> | ||
|
||
<target name="setup"> | ||
<mkdir dir="${tmp.dir}"/> | ||
</target> | ||
|
||
<target name="clean"> | ||
<delete dir="${tmp.dir}"/> | ||
</target> | ||
|
||
<target name="testRenderSimpleTemplate"> | ||
<smarty controlTemplate="test.tpl" compilePath="${tmp.dir.resolved}" outputDirectory="${tmp.dir.resolved}" outputFile="test.txt" templatePath="."> | ||
</smarty> | ||
</target> | ||
|
||
</project> |
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,2 @@ | ||
{* Smarty *} | ||
Foo |