Giter Club home page Giter Club logo

pjsunit's Introduction

PJSUnit Readme: PHP and JavaScript unit testing

Two libraries for easy unit testing in PHP and JavaScript.

  • The philosihy of the libraries are:
    • Ease to use
    • Dynamic, changeable and customizable
    • Easy to implement

Ease of use

Functions, objects, classes and theire methdods can be set up to be tested automatically by the libraries, given that they are named a specific way.

  • Examples of ease of use
    • Functions, PHP classes and JavaScript objects that has a specific suffix (ends with a specific String) will be called automatically by the libraries.

Dynamic and changeable

There are several ways of cusomizing and changing the functionality, presentation and atomization of the libraries.

  • Examples of functionality that can be customized
    • How functions, classes and methods should be named to be tested automatically.
    • Presentation of unit tests, such as presentation of classes, objects, functions, methods and general presentation.
    • Seperate adding of assertion methods to the libraries.

Easy to implement

There is no need for class extending or setting up suits for testing code. The libraries need minimal code for setting up and running unit tests. No deeper knowledge of the libraries are needed to use them. Implementation is being as simple as possible. Adding a function to the library can be done by simply calling the function, given that the function call assertion methods from the library classes.

  • Implementation
    • There is no class that a test class needs to inherit from
    • A test class is a class with a specific suffix (see Ease of Use) and those will be tested automatically
    • set_up/before and tear_down/after methods will be called automatically as the first and last methods respectively.
    • Methods named with a specific suffix (see Ease of Use) will be called in between the setUp and tearDown methods.

pjsunit's People

Contributors

frejknutar avatar

Watchers

James Cloos 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.