Windows - tips and tricks
When using Windows to bypass the main errors we recommend to follow the next :-
Before you cloned the repo, make sure that you configure git to use the correct line endings.
- Explanation / More detailed
- Easy fix :
git config --global core.autocrlf input
-
Make sure you use Windows Linux Subsystem (WSL) or at least git bash.
-
Use the recommended versions for PHP + extensions and Composer :
- Run either:
make dev
to start a local server, displaying dummy data.make exploratory-test-from-prod
to start a local server, displaying production data.
- Open
http://localhost:8080
in your browser.
To stop the containers, press Ctrl+C or run make stop
in another terminal.
To remove all cached state and artifacts from your local copy, run make clean
.
Important : Creating composer.lock
on local and permanent updates to composer files in general should only be done from the container, be aware that if this is done from local can generate additional errors. To avoid any errors running composer update
in the container is safer than running it in the local dev env. ( ex: docker-compose run composer update elife/patterns
)
When running the site locally via Docker, the parameters are supplied by /.docker/parameters.yaml
.
In order to test visible changes that come from patterns-php
when running journal
locally, run:
make update-patterns BRANCH=[branch-name-from-patterns-php]
To run all tests:
make test
To run a single test:
make test TEST=test/Controller/AuthenticationTest.php
To run all feature tests:
make feature-test
To run only one feature test:
make feature-test FEATURE=features/podcast-episode.feature
To check for any linting issues, run:
make lint
docker-compose -f docker-compose.yml -f docker-compose.ci.yml down -v
SELENIUM_IMAGE_SUFFIX=-debug docker-compose -f docker-compose.yml -f docker-compose.ci.yml up --build
docker-compose -f docker-compose.yml -f docker-compose.ci.yml run ci .ci/behat
In all but the production environment the CiviCRM client is a mock. This allows the developer to demonstrate the various screens without needing to make changes to a working CiviCRM instance.
Visit http://localhost:8080/content-alerts:
- Use green@example.com to trigger existing subscription scenario
- Use any other email to trigger subscription confirmation
For user preference interface:
- Visit http://localhost:8080/content-alerts/green to prepopulate form
- Visit http://localhost:8080/content-alerts/red to trigger expired link
Expired link interface:
- Use green@example.com to trigger email sent scenario
- Use red@example.com to trigger something went wrong scenario
Unsubscribe/optout interface:
- Visit http://localhost:8080/content-alerts/unsubscribe/green to show unsubscribe form
- Visit http://localhost:8080/content-alerts/unsubscribe/red to trigger something went wrong scenario
- Visit http://localhost:8080/content-alerts/optout/green to show opt-out form
- Visit http://localhost:8080/content-alerts/optout/red to trigger something went wrong scenario
To work on the integration with CiviCRM you will have to set the environment variable APP_ENV=prod
. And also adjust the values in .docker/parameters.yml
for crm_api_key
, crm_api_site_key
, google_api_client.refresh_token
and google_api_client.optout_unsubscribe_spreadsheet_id
to be the same as in production.