Giter Club home page Giter Club logo

slim-doctrine-behat-skeleton's Introduction

Slim & Behat Skeleton

Skeleton application using Slim 3 with Doctrine ORM and Behat. It also features migrations.

The following instructions assume you're using Docker.

Install

Run the following command to create the project (replace [my-app-name]):

$ docker run -it --rm -v $(pwd):/app composer create-project fra-c/slim-doctrine-behat-skeleton [my-app-name]

Create an .env file and edit to your needs:

$ cp .env.example .env

Implement the health check based on your needs.

Run tests

Run Behat tests with:

docker-compose run --rm -e DB_NAME=test_db -e LOG_FILENAME= php vendor/bin/behat

WARNING: When you run tests, the database specified in DB_NAME will be dropped and recreated. If you don't specify DB_NAME in the command, the .env file or environment variables will be used. DO NOT USE production credentials.

Composer command

To run composer:

docker run -it --rm -v $(pwd):/app composer [command] [options] [...]

Example:

docker run -it --rm -v $(pwd):/app composer require --dev phpunit/phpunit

Migrations

Creating migrations

Edit the Doctrine mapping yaml files as needed then run the following command to create a migration file:

docker-compose run --rm php vendor/bin/doctrine-migrations migrations:diff

Migrating

Tests run migrations automatically before every scenario.

To update the local database instead run:

docker-compose run --rm php vendor/bin/doctrine-migrations migrations:migrate

slim-doctrine-behat-skeleton's People

Contributors

dependabot[bot] avatar fra-c avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.