Giter Site home page Giter Site logo

montealegreluis / php-testing-tools Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 2.0 2.03 MB

Code examples with several PHP testing tools

License: MIT License

PHP 88.28% CSS 0.02% Makefile 2.38% Gherkin 0.23% Dockerfile 1.08% Shell 0.07% Twig 7.93%
php7 phpunit phpspec codeception behat mockery eris humbug alice

php-testing-tools's Introduction

PHP Testing tools

Build Status Code Climate license

This repository is a small Web application with a single feature with a single scenario. Its goal is to provide a set of examples using some of the coolest tools for testing and design in PHP.

It was used for a testing class. The slides are available here.

I'm also starting to use it to describe an hexagonal architecture in PHP.

Installation

It is recommended to use Docker and Docker Compose to run this example. However, it is also possible to install all the required software locally and run it without the containers.

All instructions below assume a Docker setup.

make containers     # Build the Docker images
source .alias       # Aliases to ease the use of the Docker containers
dev make bootstrap  # Install Composer dependencies for all applications

You may need a Github token as you will be running composer install for multiple applications. Please follow Composer documentation on OAuth tokens to use your newly created token with Composer. No need to do anything with your dev container, it is configured to share your local Composer configuration.

In order to run the application you'll need to seed the development database

dev make setup # Creates and seeds a development database

Usage

Web

You can run the Web application with this command:

web

Browse to http://localhost/ to see the web interface.

Console

You can transfer funds to another member like in the web application with this command:

console ewallet:transfer ABC LMN 5 # Transfers $5 MXN from sender with ID ABC to recipient with ID LMN 

Messaging

Both the Web and the console application generate domain events, those events send email notifications. Browse to http://localhost:8080/ to see the emails that are sent after transferring funds either from the console or the Web application.

To start the messaging container run this command:

messaging # Container with the cron jobs that send emails to MailCatcher based on the messages in RabbitMQ

Tests

Run the tests of all the applications and packages with this command:

dev make tests

Each folder in the ui and ewallet directories, has its own README file. Please read them for more details.

php-testing-tools's People

Contributors

montealegreluis avatar zoek1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

zoek1 pazthor

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.