-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from andreaswolf/ci-pipeline
Add end-to-end tests
- Loading branch information
Showing
7 changed files
with
125 additions
and
0 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,4 @@ | ||
/composer.lock | ||
/vendor/ | ||
|
||
/*/output/ |
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,25 @@ | ||
{ | ||
"name": "a9f/fractor-tests-typo3-flexform", | ||
"type": "project", | ||
"require": { | ||
"a9f/fractor": "@dev", | ||
"a9f/fractor-extension-installer": "@dev", | ||
"a9f/fractor-xml": "@dev", | ||
"a9f/typo3-fractor": "@dev" | ||
}, | ||
"require-dev": { | ||
"ergebnis/composer-normalize": "^2.42" | ||
}, | ||
"repositories": { | ||
"fractor": { | ||
"type": "path", | ||
"url": "../*" | ||
} | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"a9f/fractor-extension-installer": true, | ||
"ergebnis/composer-normalize": true | ||
} | ||
} | ||
} |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
|
||
TESTS_BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd)" | ||
BASE_DIR="$TESTS_BASE_DIR/../" | ||
|
||
cd $TESTS_BASE_DIR | ||
|
||
rm -r composer.lock vendor || true | ||
composer install | ||
|
||
TEST_DIR=typo3-flexform | ||
|
||
cd $TEST_DIR | ||
|
||
[[ -d ./output/ ]] && rm -rf ./output/ | ||
cp -r fixtures/ output/ | ||
|
||
cd $TESTS_BASE_DIR | ||
./vendor/bin/fractor process -c $TESTS_BASE_DIR/$TEST_DIR/fractor.php | ||
|
||
# TODO remove -b once we keep the output format when re-writing the file | ||
diff -rub $TEST_DIR/expected-output/ $TEST_DIR/output/ |
18 changes: 18 additions & 0 deletions
18
tests/typo3-flexform/expected-output/FlexFormWithSelect.xml
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<T3DataStructure> | ||
<sheets> | ||
<sDEF> | ||
<ROOT> | ||
<type>array</type> | ||
<el> | ||
<foo> | ||
<config> | ||
<type>select</type> | ||
<renderType>selectSingle</renderType> | ||
</config> | ||
</foo> | ||
</el> | ||
</ROOT> | ||
</sDEF> | ||
</sheets> | ||
</T3DataStructure> |
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<T3DataStructure> | ||
<sheets> | ||
<sDEF> | ||
<ROOT> | ||
<type>array</type> | ||
<el> | ||
<foo> | ||
<config> | ||
<type>select</type> | ||
<maxitems>1</maxitems> | ||
</config> | ||
</foo> | ||
</el> | ||
</ROOT> | ||
</sDEF> | ||
</sheets> | ||
</T3DataStructure> |
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,19 @@ | ||
<?php | ||
|
||
use a9f\Fractor\Configuration\FractorConfig; | ||
use a9f\Fractor\Fractor\DummyRule; | ||
use a9f\FractorXml\XmlFileProcessor; | ||
use a9f\Typo3Fractor\Rules\FlexForm\AddRenderTypeToFlexFormFractor; | ||
|
||
return static function (FractorConfig $config) { | ||
$config->import(__DIR__ . '/../vendor/a9f/fractor-xml/config/fractor.php'); | ||
|
||
$config->setPaths([ | ||
__DIR__ . '/output/', | ||
]); | ||
|
||
$config->withFileProcessor(XmlFileProcessor::class); | ||
|
||
$config->withRule(AddRenderTypeToFlexFormFractor::class); | ||
$config->withRule(DummyRule::class); | ||
}; |