GithubHelp home page GithubHelp logo

isabella232 / slim4-ci Goto Github PK

View Code? Open in Web Editor NEW

This project forked from slimphp/slim4-ci

0.0 0.0 0.0 40 KB

Simple test for Slim4 with various PSR-7 implementations (using Travis-CI)

License: MIT License

PHP 100.00%

slim4-ci's Introduction

Slim4-CI

This repository contains a small Slim4 application that initially does not define a specific PSR-7 implementation. It uses Continuous Integration (Travis-CI) to build and check the application against the four PSR-7 implementations supported by default by the slim framework.

Status

# PSR-7 Implementation Status
1 Slim PSR-7 Slim
2 Nyholm Nyholm
3 Guzzle Guzzle
4 Zend Zend

Note: Travis-CI is configured to be triggered automatically at least every 24 hours.

Status using the development branch of Slim (4.x)

The following status used the development branch of Slim (4.x) to test against.

# PSR-7 Implementation Status
5 Slim PSR-7 Slim
6 Nyholm Nyholm
7 Guzzle Guzzle
8 Zend Zend

Note: Travis-CI is configured to be triggered automatically at least every 24 hours.

Explanation

When triggered, Travis-CI creates four different virtual machines. Each installs an Apache web server and this application. The web server is configured such that http://localhost/ points to the subdirectory public. Then each virtual machine would require via composer a different PSR-7 implementation.

Eventually the PHPUnit test is launched which would use the Guzzle HTTP Client to make http requests and validate the responses.

Files

Web Application

  • public/.htaccess This file contains the server override settings.
  • public/index.php This is the entry point on the server.
  • composer.json This is the composer file.

Travis-CI

  • build/travis-ci-apache.conf The apache configuration.
  • .travis.yml The travis configuration.

Tests

  • tests/bootstrap.php The tests bootstrap.
  • tests/*Test.php The PHPUnit test classes.

Development

Help in form of issues or pull requests would be very much welcomed.

  • Clone your fork of this repository.
  • Create a new branch for every patch, feature or improvement.
  • Install the required libraries.
    $ composer install
  • Decide which PSR-7 implementation you would like to use during development and install it using composer. Note that this would modify composer.json and therefore you must make sure that you do not commit those changes.
    • Slim
      $ composer require slim/psr7
    • Nyholm
      $ composer require nyholm/psr7 nyholm/psr7-server
    • Guzzle
      $ composer require guzzlehttp/psr7 http-interop/http-factory-guzzle
    • Zend
      $ composer require zendframework/zend-diactoros
  • Install a web server, make sure that localhost points to the public/ subdirectory and start the web server.
  • Run the tests
    $ vendor/bin/phpunit

By default you will get 1 skipped test. That test works only, if the environment variable PSR7 is set to either Slim, Nyholm, Guzzle or Zend.

slim4-ci's People

Contributors

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