Development - datinglibre/DatingLibre Wiki

Minimum requirements

The documentation assumes a computer running a recent version of Ubuntu, or Debian.


Additional requirements to run Behat tests requiring Javascript:


1. Download and connect DatingLibre to the datinglibre-app-bundle

The following instructions are for contributing to the datinglibre-app-bundle. You don't need to do this if you don't want to contribute code to the bundle. If you have just created a project based on DatingLibreDemo and only want to override the bundle, you can skip to step 3.

The DatingLibre project is used as a skeleton to run the datinglibre-app-bundle. The project is separated in this way, so that parts of the bundle can be overridden, whilst keeping the ability to keep updated with new DatingLibre features using composer update.

Clone both DatingLibre and the datinglibre-app-bundle then add the following to the DatingLibre composer.json file, substituting /home/datinglibre/datinglibre-app-bundle with the path to the bundle in your filesystem:

    "repositories": [
        {
            "type": "path",
            "url": "/home/datinglibre/datinglibre-app-bundle",
            "options": {
                "symlink": true
            }
        }
    ]

Then update your composer.json to use the local linked dependency.

       "datinglibre/datinglibre-app-bundle": "@dev"

2. Run composer

~/DatingLibre$ composer update    

3. Start the internal webserver:

~/DatingLibre$ symfony serve

4. Run the setup script

This will start mailhog, S3Ninja and postgres docker containers, run the database migrations and install test fixtures, install Javascript dependencies, and use webpack to package these into /public.

~/DatingLibre$ ./setup.sh

docker will expose the following services to localhost:

Service Ports
MailHog 1025/SMTP
MailHog UI 8025/HTTP
Postgres 5432/TCP
S3 ninja 9444/HTTP

You should now be able to modify the PHP etc. files in ~/datinglibre-app-bundle, add Behat tests for functionality in ~/DatingLibre and see your changes on localhost:8000.

Testing

1. Start Selenium (optional, for Javascript tests):

java -jar  selenium-server-standalone.jar

2. Increase allowed number of open files

You might need to increase the number of open files that are allowed on your system, if running the tests fails with "too many open files". You can do this temporarily with:

ulimit -n 65535

3. Run tests

A good test to begin with is the "I can register for an account" test, as after the test has run, you will be able to login with [email protected] and password:

~/DatingLibre$ ./vendor/bin/behat features/registration/registration.feature:6
Run behat BDD scenarios without Javascript tests:
~/DatingLibre$ ./vendor/bin/behat --tags ~javascript
Run all behat BDD scenarios:
~/DatingLibre$ ./vendor/bin/behat

The default password for all test accounts is password.

Code Style

php-cs-fixer is configured with PSR1 and PSR2 standards.

~/datinglibre-app-bundle$ ./vendor/bin/php-cs-fixer fix