Giter Site home page Giter Site logo

eddiejibson / sido Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 54 KB

Simplistic PHP testing library with 0 composer dependencies.

Home Page: https://sido.jibson.me

License: MIT License

PHP 100.00%
php unit unit-testing unit-testing-framework testing framework

sido's Introduction

sido

sido (시도) meaning : Try/attempt

A very simplistic PHP unit testing library.

If you're finding this library of use, please consider starring it on the GitHub repository. It makes our night sky better. ⭐

Read the documentation here

Installation

composer require --dev eddiejibson/sido:dev-master

Why sido?

  • Simple and light
  • Provides test report generation in the junit-like style - suitable for immediate use on platforms such as CircleCI (no need to format it specially yourself)
  • 0 composer dependencies
  • Few assertions (easy to get used to) which still provides everything you need
  • Provides a Discord notification utility via a webhook (notify you and your team easily on completion of a test)

Basic example

require "/vendor/autoload.php"; //Require composer's autoload

//Custom options can be set. All are Optional
$options = [
    "report" => dirname(__FILE__) . "/reports/" . "report.xml", //Report location. Set to false to disable generation fully.
    //On test completion, webhooks can be run. You can set some here.
    "discord" => [ //Discord webhook settings. If not set, will default to false (not used)
        "webhook" => "https://discordapp.com/api/webhooks/id/token", //Your Discord webhook URL. 
        //This can be created by editing the Discord channel and navigating to the 'webhooks' section
        "name" => "Eddie's test runner" //The name of the bot. This is Optional
    ]
];

//Intialize the Sido class and pass the options defined into it.
//The options array is not required and you may pass in nothing.
$sido = new \eddiejibson\Sido($options);

//Set the test you're currently running
$sido->setTest("Array test");

//Test array we will be using
$array = ["hello" => true];

//Add testcases to the test
$sido->should(is_array($array), "Be an array");
$sido->should(count($array) > 0, "Have a length greater than 0");

//Add another test
$sido->setTest("Random test");

//Add a testcase to this test
$sido->should((1 == 1), "1 should equal 1");

//And that's pretty much it...

Example of how to integrate Sido with CircleCI for automated testing

Documentation

The full documentation can be viewed here.

sido's People

Contributors

eddiejibson avatar ocramius avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

sido's Issues

feedback

sido/docs/should.md this doc looks wrong. Your example is not using should()

Also I think it would be good if you added a screenshot of what the output looks like in the main README.md

Correct Docs Link

4th sentence, the url to docs needs to have the proper colon (:) after https

change: https//sido.jibson.me

to : https://sido.jibson.me

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.