Skip to content

eugene-matvejev/symfony-battleship

Repository files navigation

join our join_us_on_slack channel

master heroku < authorization prototype >
TDD tests
< Circle CI > PHPUnit build build build
BDD tests
< Circle CI > Behat build build build
< Circle CI > Kahlan build build build
coverage
< codecov.io > coverage coverage coverage

other CI engines reports [on master]

code-climate-code-quality travis-build-status-master sensio-insight-framework codeship-build-status-master

DEMO : https://battleship-game-api.herokuapp.com/ [out of sync with master, because front-end is not ready yet]

Battleship Game API

THIS IS SPARE TIME PROJECT, WORK IN PROGRESS! HIGHLY EXPERIMENTAL!!!

project purpose

  • to try out cutting edge technologies and services, modern approaches such as Test Automation, Continuous Integration{CI}|Deployment{CD}
  • simulate database loading [~500 transactions per request]
  • deliver preview about my technical knowledge before the job interview
  • demonstrate technical knowledege level prior job interview

game cheat-code

  • AI players have only one ship[single-cell] which is located at B2 cell [purpose: easier manual testing]
    • if you will hit B2 cell - you will win

software requirements

  • PHP 7.1
  • one of supported database engines
    • MySQL >= 5.5
    • MariaDB >= 9.0
    • PostgreSQL >= 9.3
    • SQLite >= 3
  • http server with CGI e.g. [example: apache, nginx]
  • composer >= 1.0.3

technology stack

key technologies

used patterns

  • Front Controller
  • MVC
  • ORM
  • Data Mapper
  • Builder
  • Strategy
  • Factory
  • Singleton
  • Delegation
  • Registry
  • Service Locator
  • Event Dispatcher
  • Dependency Injection

PHP-FIG

workflow

  • new functionality merged into master branch only via pull requests
  • each pull request have callback to trigger CI engines such as Travis, Circle, CodeShip, Sensiolabs Insight, CodeCov
  • result of each pull request is ready-to-use release - using Continuous Delivery principles

gitflow

  • master branch: stable source code, contains release-ready source
  • heroku branch: reflects current deployed app at heroku [Continuous Deployment]
  • prototype*_ branch: contains new idea [pull request of prototype branch is always next major version release]
  • pull requests follows semantic vesion

how to install

how to execute tests

if you've ant installed locally, you can run all tests via shortcut command: $ ant test or just $ ant database_name_test in parameters.yml reflects database name for the test env. test database need to be wiped and seeded prior tests execution (for PHPUnit tests only, Kahlan and Behat tests can be executed on 'dirty' database)

sequence of steps to prepare test database

  • $ php bin/console doctrine:database:create --env=test
  • $ php bin/console doctrine:migrations:migrate --env=test
  • $ php bin/console doctrine:fixtures:load --env=test

how to execute tests

  • $ php bin/phpunit -c . or $ php bin/phpunit -c . --no-coverage to disable coverage report
  • $ php bin/behat
  • $ php bin/kahlan

http server config examples