-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #67: Fix tests and details parsing.
- Loading branch information
Showing
8 changed files
with
140 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: '2' | ||
services: | ||
php56: | ||
image: fpfis/php56-dev | ||
volumes: | ||
- .:/var/www/html | ||
environment: | ||
XDEBUG_CONFIG: "remote_enable=1 remote_host=${DOCKER_HOST_IP} remote_port=9000 idekey=PHPSTORM remote_autostart=1" | ||
PHP_IDE_CONFIG: "serverName=Test" | ||
|
||
php71: | ||
image: fpfis/php71-dev | ||
volumes: | ||
- .:/var/www/html | ||
environment: | ||
XDEBUG_CONFIG: "remote_enable=1 remote_host=${DOCKER_HOST_IP} remote_port=9000 idekey=PHPSTORM remote_autostart=1" | ||
PHP_IDE_CONFIG: "serverName=Test" |
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,53 @@ | ||
<?php | ||
|
||
namespace EC\Poetry\Tests; | ||
|
||
use EC\Poetry\Messages\Components\AbstractComponent; | ||
use EC\Poetry\Poetry; | ||
use Symfony\Component\Yaml\Yaml; | ||
|
||
/** | ||
* Class SensitizationTest. | ||
* | ||
* @package EC\Poetry\Tests | ||
*/ | ||
class SanitizationTest extends AbstractTest | ||
{ | ||
|
||
/** | ||
* @param string $name | ||
* @param array $setters | ||
* @param array $getters | ||
* | ||
* @dataProvider dataProvider | ||
*/ | ||
public function testSensitization($name, array $setters, array $getters) | ||
{ | ||
$poetry = new Poetry(); | ||
/** @var AbstractComponent $component */ | ||
$component = $poetry->get('component.'.$name); | ||
|
||
foreach ($setters as $setter => $value) { | ||
$component->$setter($value); | ||
} | ||
|
||
$xml = $poetry->getRenderEngine()->render($component->getTemplate(), [ | ||
'component' => $component, | ||
]); | ||
|
||
$actual = $poetry->get('component.'.$name)->fromXml($xml); | ||
// If XML is not valid test will fail here. | ||
$xml = new \SimpleXMLElement($xml); | ||
foreach ($getters as $getter => $value) { | ||
expect($actual->$getter($value))->to->equal($value); | ||
} | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function dataProvider() | ||
{ | ||
return Yaml::parse($this->getFixture('sanitization.yml')); | ||
} | ||
} |
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,37 @@ | ||
- component: details | ||
setters: | ||
setClientId: "<ID>" | ||
setResponsible: "</Responsible>" | ||
setApplicationId: "applicationId" | ||
setAuthor: "DIGIT \ <> " | ||
setRequester: "DGCOMM \\<>" | ||
setTitle: "Title > <" | ||
setRemark: "Remark!!{}" | ||
setType: "INTER*^%(#" | ||
setDestination: "AUTRE{}<[[]]" | ||
setProcedure: "NEANT" | ||
setDelay: "11/12/\\2007" | ||
setRequestDate: "11\/12/2007" | ||
setStatus: "Ready!><" | ||
setInterServices: "<Yes?" | ||
setInterInstitution: "/<Yes>" | ||
setReferenceFilesRemark: "<<<Note>>>" | ||
setWorkflowCode: "!!STS" | ||
getters: | ||
getClientId: "<ID>" | ||
getResponsible: "</Responsible>" | ||
getApplicationId: "applicationId" | ||
getAuthor: "DIGIT \ <> " | ||
getRequester: "DGCOMM \\<>" | ||
getTitle: "Title > <" | ||
getRemark: "Remark!!{}" | ||
getType: "INTER*^%(#" | ||
getDestination: "AUTRE{}<[[]]" | ||
getProcedure: "NEANT" | ||
getDelay: "11/12/\\2007" | ||
getRequestDate: "11\/12/2007" | ||
getStatus: "Ready!><" | ||
getInterServices: "<Yes?" | ||
getInterInstitution: "/<Yes>" | ||
getReferenceFilesRemark: "<<<Note>>>" | ||
getWorkflowCode: "!!STS" |