This repository has been archived by the owner on May 8, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
85 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
/** | ||
* The tests for opt:load instruction. | ||
* | ||
* @author Tomasz "Zyx" Jędrzejewski | ||
* @copyright Copyright (c) 2009 Invenzzia Group | ||
* @license http://www.invenzzia.org/license/new-bsd New BSD License | ||
*/ | ||
|
||
require_once('./Extra/TestFS.php'); | ||
require_once('./Extra/TestFSBase.php'); | ||
|
||
/** | ||
* @covers Opt_Compiler_Class | ||
* @covers Opt_Compiler_Format | ||
* @covers Opt_Compiler_Processor | ||
* @covers Opt_Instruction_Root | ||
* @covers Opt_Instruction_Extend | ||
* @runTestsInSeparateProcesses | ||
*/ | ||
class Package_Instruction_ForTest extends Extra_TestFSBase | ||
{ | ||
|
||
/** | ||
* Configuration method. | ||
* @param Opt_Class $tpl | ||
*/ | ||
public function configure(Opt_Class $tpl) | ||
{ | ||
$tpl->parser = 'Opt_Parser_Xml'; | ||
$tpl->register(Opt_Class::OPT_COMPONENT, 'opt:myComponent', 'Extra_Mock_Component'); | ||
$tpl->register(Opt_Class::OPT_BLOCK, 'opt:myBlock', 'Extra_Mock_Block'); | ||
} // end configure(); | ||
|
||
/** | ||
* Provides the list of test cases. | ||
* @return array | ||
*/ | ||
public static function dataProvider() | ||
{ | ||
return array(0 => | ||
array('For/for_basic.txt'), | ||
array('For/for_separator_attr.txt'), | ||
array('For/for_separator_tag.txt'), | ||
); | ||
} // end dataProvider(); | ||
|
||
/** | ||
* @dataProvider dataProvider | ||
* @runInSeparateProcess | ||
*/ | ||
public function testInstructions($testCase) | ||
{ | ||
return $this->_checkTest(dirname(__FILE__).'/Tests/'.$testCase); | ||
} // end testInstructions(); | ||
} // end Package_Instruction_ForTest; |
This file was deleted.
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
24 changes: 24 additions & 0 deletions
24
tests/Package/Instruction/Tests/For/for_separator_attr.txt
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,24 @@ | ||
Test checks the cooperation of opt:for and separators. | ||
|
||
>>>>templates/test.tpl | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | ||
<opt:root xmlns:opt="http://xml.invenzzia.org/opt"> | ||
<opt:for begin="@i is 0" while="@i lt 10" iterate="@i++" separator="str:\::"> | ||
{@i} | ||
</opt:for> | ||
</opt:root> | ||
|
||
>>>>expected.txt | ||
OUTPUT | ||
|
||
>>>>result.txt | ||
0:: | ||
1:: | ||
2:: | ||
3:: | ||
4:: | ||
5:: | ||
6:: | ||
7:: | ||
8:: | ||
9 |
5 changes: 2 additions & 3 deletions
5
...s/Package/Instruction/Tests/For/for_3.txt → ...struction/Tests/For/for_separator_tag.txt
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