Giter VIP home page Giter VIP logo

php.testassignment's Introduction

Linkfire PHP assignment

The code and objectives of this coding assignment are set up to emulate the basic structure of Linkfire's Redirector project, the platform responsible for routing visitors and generating our iconic music and ticket landing pages.

This is a dockerized MVC application based on Phalcon PHP, and the tasks are designed to take you around the basic principles of working with the platform.

We will evaluate you on the following parameters:

  • Ability to write code that is clean, readable and easy to maintain.
  • Ability to understand the principles of, and organising an MVC project.
  • Ability to recognize where a pattern/principle could be used, and the ability to apply this pattern/principle.
  • Ability to organize and document your code.
  • Ability write good and clear unit tests.

Expected time to solve this assignment is 2 to 4 hours.

Tasks

  1. Create a service with a function that returns a model.
  2. Call the service function from controller and output the model as JSON.
  3. Add routing and controller actions to support different url structures.
  4. Get service from DI container in controller instead of doing new Service().
  5. Write unit tests for the service function.

How to set up project to run locally

Requirements

  • Docker
  • Docker-compose

Setup

clone repository to <PATH_TO_REPO_ROOT>

Run the following commands

docker-compose build
docker run -v ${PWD}:/app -w /app composer:latest composer install --ignore-platform-reqs --no-scripts --no-interaction --prefer-dist --optimize-autoloader
docker-compose up

project is now available on http://localhost:80/

Running tests

docker run --rm -v ${PWD}:/var/www/html <php_image_name> vendor/bin/phpunit --testdox

# e.g. 
# docker run --rm -v ${PWD}:/var/www/html phptestassigment_php vendor/bin/phpunit --testdox

php.testassignment's People

Contributors

mllinkfire avatar raahede avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.