Giter VIP home page Giter VIP logo

docker-image's Introduction

Kahlan


Build Status License

Latest Stable Version Total Downloads Code Coverage

Kahlan is a full-featured Unit & BDD test framework a la RSpec/JSpec which uses a describe-it syntax and moves testing in PHP one step forward.

Kahlan lets you stub or monkey patch your code directly like in Ruby or JavaScript without any required PECL-extensions.

Videos

IRC

chat.freenode.net (server) #kahlan (channel)

Documentation

See the full documentation here

Requirements

  • PHP 7.2+
  • Composer
  • phpdbg or Xdebug (only required for code coverage analysis)

Main Features

  • RSpec/JSpec syntax
  • Code Coverage metrics (xdebug or phpdbg required)
  • Handy stubbing system (mockery or prophecy are no longer needed)
  • Set stubs on your class methods directly (i.e allows dynamic mocking)
  • Ability to Monkey Patch your code (i.e. allows replacement of core functions/classes on the fly)
  • Check called methods on your classes/instances
  • Built-in Reporters (Terminal or HTML reporting through istanbul or lcov)
  • Built-in Exporters (Coveralls, Code Climate, Scrutinizer, Clover)
  • Extensible, customizable workflow

Syntax

<?php

describe("Example", function() {

    it("makes an expectation", function() {

         expect(true)->toBe(true);

    });

    it("expects methods to be called", function() {

        $user = new User();
        expect($user)->toReceive('save')->with(['validates' => false]);
        $user->save(['validates' => false]);

    });

    it("stubs a function", function() {

        allow('time')->toBeCalled()->andReturn(123);
        $user = new User();
        expect($user->save())->toBe(true)
        expect($user->created)->toBe(123);

    });

    it("stubs a class", function() {

        allow('PDO')->toReceive('prepare', 'fetchAll')->andReturn([['name' => 'bob']]);
        $user = new User();
        expect($user->all())->toBe([['name' => 'bob']]);

    });

});

Screenshots

Example of default reporting:

dot_reporter

Example of verbose reporting:

verbose_reporter

Example of code coverage on a specific scope:

code_coverage

Installation

via Composer

$ composer require --dev kahlan/kahlan

Note: Kahlan uses the Semantic Versioning and maintains a CHANGELOG to help you easily understand what's happening.

via Git clone

git clone git://github.com/kahlan/kahlan.git
cd kahlan
composer install
bin/kahlan              # to run specs or,
bin/kahlan --coverage=4 # to run specs with coverage info for namespaces, classes & methods (require xdebug)

docker-image's People

Contributors

tyranron avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

samsonasik

docker-image's Issues

To be done

Roadmap

  • Dockerfiles generation from template
  • install phpdbg in php5 containers (no sense, see why)
  • install Xdebug
  • tests included into build process (to check that containers are build as expected)
  • create README.md
  • automated builds from master branch
  • license
  • HOWTO.md for maintainers

Deprecation and archivation

@jails I have no interest anymore in maintaining this Docker image. And seems folks haven't widely adopted it. So, if nobody wants to pick up it, I'll archive the repository in one month.

Re-link this repo on DockerHub for automated builds

Hi, @jails.

Unfortunately, DockerHub has changed its platform and integration recently, so our automatic builds on pushes to this repo do not work anymore. Despite I have access to DockerHub repo settings, I have no access to kahlan org on GitHub, so cannot link/re-link repos for it.

Please, re-link this GitHub repository to DockerHub kahlan/kahlan repo on this page:
https://cloud.docker.com/u/kahlan/repository/docker/kahlan/kahlan/builds/edit

So, I will be able to reconfigure automatic builds.

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.