-
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.
Merge pull request #465 from essexcountycouncil/feature/ECCW-693
feat(ECCW-509): DDEV commands, phpcs*.xml, phpunit*.xml.
- Loading branch information
Showing
10 changed files
with
185 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
## Description: Run phpcbf to automatically fix some phpcs errors. | ||
## Usage: phpcbf | ||
## Example: "ddev phpcbf" | ||
|
||
{ | ||
/var/www/html/bin/phpcbf --standard=phpcbf-ecc.xml $* | ||
} || { | ||
echo Fix the remaining issues manually. | ||
} |
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,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
## Description: Run phpcs in the web container. | ||
## Usage: phpcs | ||
## Example: "ddev phpcs" | ||
|
||
{ | ||
/var/www/html/bin/phpcs --standard=phpcs-ecc.xml $* | ||
} || { | ||
echo Please fix these issues. | ||
} |
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,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
## Description: Run phpunit in the web container to run phpunit tests. | ||
## Usage: phpunit | ||
## Example: "ddev phpunit" | ||
|
||
export SYMFONY_DEPRECATIONS_HELPER=weak | ||
/var/www/html/bin/phpunit -c /var/www/html/phpunit-ecc.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,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
## Description: Run phpunit in the web container to run phpunit tests on LGD. | ||
## Usage: phpunit-lgd | ||
## Example: "ddev phpunit-lgd" | ||
|
||
/var/www/html/bin/phpunit -c /var/www/html/phpunit-lgd.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,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
## Description: Run phpunit in the web container to run phpunit tests. | ||
## Usage: phpunit-with-deprecations | ||
## Example: "ddev phpunit-with-deprecations" | ||
|
||
/var/www/html/bin/phpunit -c /var/www/html/phpunit-ecc.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,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ruleset name="ecc"> | ||
<description>PHP CodeSniffer configuration for ECC custom modules.</description> | ||
|
||
<arg name="extensions" value="inc,install,module,php,profile,test,theme,yml"/> | ||
<config name="drupal_core_version" value="10"/> | ||
|
||
<file>web/modules/custom/</file> | ||
|
||
<rule ref="./vendor/drupal/coder/coder_sniffer/Drupal"/> | ||
<rule ref="./vendor/drupal/coder/coder_sniffer/DrupalPractice"/> | ||
</ruleset> |
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,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ruleset name="ecc"> | ||
<description>PHP CodeSniffer configuration for ECC.</description> | ||
|
||
<arg name="extensions" value="inc,install,module,php,profile,test,theme,yml"/> | ||
<config name="drupal_core_version" value="10"/> | ||
|
||
<file>web/modules/custom/</file> | ||
<file>web/themes/contrib/ecc_theme</file> | ||
|
||
<rule ref="./vendor/drupal/coder/coder_sniffer/Drupal"/> | ||
<rule ref="./vendor/drupal/coder/coder_sniffer/DrupalPractice"/> | ||
</ruleset> |
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ruleset name="localgovdrupal"> | ||
<description>PHP CodeSniffer configuration for LocalGovDrupal.</description> | ||
|
||
<arg name="extensions" value="inc,install,module,php,profile,test,theme,yml"/> | ||
<config name="drupal_core_version" value="10"/> | ||
|
||
<file>web/modules/contrib/</file> | ||
<file>web/profiles/contrib/localgov/</file> | ||
<file>web/themes/contrib/</file> | ||
|
||
<!-- Exclude 3rd party code --> | ||
<exclude-pattern>web\/modules\/contrib\/(?!localgov_.*)</exclude-pattern> | ||
<exclude-pattern>web\/themes\/contrib\/(?!localgov_.*)</exclude-pattern> | ||
|
||
<rule ref="./vendor/drupal/coder/coder_sniffer/Drupal"/> | ||
<rule ref="./vendor/drupal/coder/coder_sniffer/DrupalPractice"/> | ||
|
||
</ruleset> |
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,44 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit bootstrap="web/core/tests/bootstrap.php" colors="true" | ||
beStrictAboutTestsThatDoNotTestAnything="true" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutChangesToGlobalState="true" | ||
printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter"> | ||
|
||
<php> | ||
<!-- Set error reporting to E_ALL. --> | ||
<ini name="error_reporting" value="32767"/> | ||
<!-- Do not limit the amount of memory tests take to run. --> | ||
<ini name="memory_limit" value="-1"/> | ||
<!-- Example SIMPLETEST_BASE_URL value: http://localhost --> | ||
<env name="SIMPLETEST_BASE_URL" value="https://essex-public.ddev.site/"/> | ||
<!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/databasename#table_prefix --> | ||
<env name="SIMPLETEST_DB" value="mysql://database:database@database/database"/> | ||
<!-- Example BROWSERTEST_OUTPUT_DIRECTORY value: /path/to/webroot/sites/simpletest/browser_output --> | ||
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value=""/> | ||
<!-- To have browsertest output use an alternative base URL. For example if | ||
SIMPLETEST_BASE_URL is an internal DDEV URL, you can set this to the | ||
external DDev URL so you can follow the links directly. | ||
--> | ||
<env name="BROWSERTEST_OUTPUT_BASE_URL" value=""/> | ||
</php> | ||
|
||
<testsuites> | ||
<testsuite name="modules"> | ||
<directory>/var/www/html/web/modules/custom/</directory> | ||
</testsuite> | ||
<testsuite name="themes"> | ||
<directory>/var/www/html/web/themes/contrib/ecc_theme</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<listeners> | ||
<listener class="\Drupal\Tests\Listeners\DrupalListener"> | ||
</listener> | ||
<!-- The Symfony deprecation listener has to come after the Drupal listener --> | ||
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"> | ||
</listener> | ||
</listeners> | ||
|
||
</phpunit> |
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,52 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit bootstrap="web/core/tests/bootstrap.php" colors="true" | ||
beStrictAboutTestsThatDoNotTestAnything="true" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutChangesToGlobalState="true" | ||
printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter"> | ||
|
||
<php> | ||
<!-- Set error reporting to E_ALL. --> | ||
<ini name="error_reporting" value="32767"/> | ||
<!-- Do not limit the amount of memory tests take to run. --> | ||
<ini name="memory_limit" value="-1"/> | ||
<!-- Example SIMPLETEST_BASE_URL value: http://localhost --> | ||
<env name="SIMPLETEST_BASE_URL" value="https://essex-public.ddev.site"/> | ||
<!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/databasename#table_prefix --> | ||
<env name="SIMPLETEST_DB" value="mysql://database:database@database/database"/> | ||
<!-- Example BROWSERTEST_OUTPUT_DIRECTORY value: /path/to/webroot/sites/simpletest/browser_output --> | ||
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value=""/> | ||
<!-- To have browsertest output use an alternative base URL. For example if | ||
SIMPLETEST_BASE_URL is an internal DDEV URL, you can set this to the | ||
external DDev URL so you can follow the links directly. | ||
--> | ||
<env name="BROWSERTEST_OUTPUT_BASE_URL" value=""/> | ||
</php> | ||
|
||
<testsuites> | ||
<testsuite name="profile"> | ||
<directory>/var/www/html/web/profiles/contrib/localgov</directory> | ||
</testsuite> | ||
<testsuite name="modules"> | ||
<directory>/var/www/html/web/modules/contrib/localgov_*</directory> | ||
<exclude>/var/www/html/web/modules/contrib/localgov_alert_banner/modules/group_alert_banner/tests</exclude> | ||
</testsuite> | ||
<testsuite name="themes"> | ||
<directory>/var/www/html/web/themes/contrib/localgov_*</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<listeners> | ||
<listener class="\Drupal\Tests\Listeners\DrupalListener"> | ||
</listener> | ||
<!-- The Symfony deprecation listener has to come after the Drupal listener --> | ||
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"> | ||
</listener> | ||
</listeners> | ||
|
||
<logging> | ||
<log type="testdox-text" target="php://stdout"/> | ||
</logging> | ||
|
||
</phpunit> |