-
Notifications
You must be signed in to change notification settings - Fork 10
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 #37 from sitegeist/FEATURE/testing
FEATURE: Add unit and functional tests
- Loading branch information
Showing
19 changed files
with
1,537 additions
and
47 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 |
---|---|---|
@@ -1,3 +1,19 @@ | ||
composer.lock | ||
Packages | ||
vendor | ||
/vendor | ||
/Build/Behat/* | ||
/Build/PhpCodesniffer/* | ||
/Build/BuildEssentials | ||
/Build/Reports | ||
/Build/Resources | ||
/Data/ | ||
/Packages/ | ||
/Web/ | ||
/bin/ | ||
/Readme.rst | ||
/Upgrading.rst | ||
/flow | ||
/flow.bat | ||
/Tests/Reports | ||
*.example | ||
.phpunit.result.cache | ||
Configuration/README |
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,10 @@ | ||
'Sitegeist.LostInTranslation.Testing:NodeWithAutomaticTranslation': | ||
superTypes: | ||
'Neos.Neos:Node': true | ||
properties: | ||
inlineEditableStringProperty: | ||
type: string | ||
ui: | ||
inlineEditable: true | ||
stringProperty: | ||
type: string |
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,9 @@ | ||
roles: | ||
'Neos.Flow:Everybody': | ||
privileges: | ||
- | ||
privilegeTarget: 'Neos.Neos:Backend.GeneralAccess' | ||
permission: GRANT | ||
- | ||
privilegeTarget: 'Sitegeist.LostInTranslation:AccessBackendModule' | ||
permission: GRANT |
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,38 @@ | ||
Neos: | ||
Flow: | ||
persistence: | ||
backendOptions: | ||
dbname: 'flow_functional_testing' | ||
i18n: | ||
defaultLocale: de | ||
ContentRepository: | ||
contentDimensions: | ||
language: | ||
label: Languages | ||
icon: language | ||
# The default dimension that is applied when creating nodes without specifying a dimension | ||
default: de | ||
# The default preset to use if no URI segment was given when resolving languages in the router | ||
defaultPreset: de | ||
presets: | ||
de: | ||
label: Deutsch | ||
values: | ||
- de | ||
uriSegment: '' | ||
en: | ||
label: English | ||
values: | ||
- en | ||
- de | ||
uriSegment: 'en' | ||
options: | ||
translationStrategy: 'sync' | ||
it: | ||
label: Italiano | ||
values: | ||
- it | ||
- de | ||
uriSegment: 'it' | ||
options: | ||
translationStrategy: 'once' |
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,35 @@ | ||
# Testing | ||
|
||
This package comes with an extensive automated testing suite, which is automatically run for every | ||
pull request in GitHub. | ||
|
||
## CodeSniffer | ||
|
||
This tool helps to find and fix code style issues in this package. | ||
To run CodeSniffer tests first ensure that you installed the required | ||
packages using `composer install`. Then run `composer test:style`. | ||
|
||
|
||
To run the automated fixing of most of the styling issues, you can also execute `composer fix:style`. | ||
|
||
## PHPStan | ||
|
||
This tool helps to find obvious bugs in your PHP code. | ||
To run PHPStan first ensure that you installed the required | ||
packages using `composer install`. Then run `composer test:stan`. | ||
|
||
## Unit Testing | ||
|
||
To run unit tests first ensure that you installed the required | ||
packages using `composer install`. Then run `composer test:unit`. | ||
|
||
## Functional Testing | ||
|
||
To run functional tests on your local machine, install this package in a fresh Neos installation. | ||
Instructions on how to do that can be found here: https://docs.neos.io/guide/installation-development-setup | ||
|
||
Once you have done that, you can run the functional tests by executing the following command *in the folder of the Neos installation*: | ||
|
||
```shell | ||
FLOW_CONTEXT=Testing bin/phpunit --colors --stop-on-failure -c DistributionPackages/Sitegeist.LostInTranslation/Tests/FunctionalTests.xml --testsuite "LostInTranslation" --verbose | ||
``` |
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,10 @@ | ||
<?php | ||
|
||
namespace Sitegeist\LostInTranslation\Tests\Functional; | ||
|
||
use Neos\Flow\Tests\FunctionalTestCase; | ||
|
||
abstract class AbstractFunctionalTestCase extends FunctionalTestCase | ||
{ | ||
protected static $testablePersistenceEnabled = true; | ||
} |
Oops, something went wrong.