-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
7 changed files
with
120 additions
and
7 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
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 @@ | ||
<?php declare(strict_types = 1); | ||
namespace Templado\Engine; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
require __DIR__ . '/viewmodel.php'; | ||
|
||
class Issue5Test extends TestCase { | ||
|
||
public function testIssueIsNoLongerReproduceable() { | ||
|
||
$templadoFile = new FileName(__DIR__ . '/formTest.xhtml'); | ||
$html = Templado::loadHtmlFile($templadoFile); | ||
$html->applyViewModel(new Issue5_ViewData()); | ||
|
||
$this->assertXmlStringEqualsXmlString( | ||
file_get_contents(__DIR__ . '/expected.html'), | ||
$html->asString() | ||
); | ||
|
||
} | ||
} | ||
|
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,18 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<title>Title</title> | ||
</head> | ||
<body> | ||
<div id="include"> | ||
<div> | ||
<form name="form1" action="/"> | ||
<button property="button1" formaction="/target1">Changed action to: /target1</button> | ||
<button property="button2" formaction="/target2">Changed action to: /target2</button> | ||
<button property="button3" formaction="/target3">Changed action to: /target3</button> | ||
<button property="button4" formaction="/target4">Changed action to: /target4</button> | ||
</form> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
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,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE html> | ||
<html xml:lang="en" lang="en"> | ||
<head> | ||
<title>Title</title> | ||
</head> | ||
<body> | ||
|
||
<div id="include"> | ||
<div> | ||
<form name="form1" action="/"> | ||
<button property="button1" formaction="">button 1</button> | ||
<button property="button2" formaction="">button 2</button> | ||
<button property="button3" formaction="">button 3</button> | ||
<button property="button4" formaction="">button 4</button> | ||
</form> | ||
</div> | ||
</div> | ||
|
||
|
||
</body> | ||
</html> |
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,31 @@ | ||
<?php declare(strict_types = 1); | ||
namespace Templado\Engine; | ||
|
||
class Issue5_Button { | ||
private $action; | ||
public function __construct(string $action) { | ||
$this->action = $action; | ||
} | ||
public function getFormaction() { | ||
return $this->action; | ||
} | ||
|
||
public function asString(): string { | ||
return 'Changed action to: ' . $this->action; | ||
} | ||
} | ||
|
||
class Issue5_ViewData { | ||
public function getButton1() { | ||
return new Issue5_Button('/target1'); | ||
} | ||
public function getButton2() { | ||
return new Issue5_Button('/target2'); | ||
} | ||
public function getButton3() { | ||
return new Issue5_Button('/target3'); | ||
} | ||
public function getButton4() { | ||
return new Issue5_Button('/target4'); | ||
} | ||
} |