Giter Club home page Giter Club logo

musicalocaliser's Introduction

CodeIgniter with SimpleTest

Updates:

The CodeIgniter core is now being converted to using phpUnit so I'm using simpletest as a stopgap measure.

In additon to the origional version I've added the ability to output the test results in Junit format for use in continuous integration systems based on work from https://techknowhow.library.emory.edu/blogs/rsutton/2009/07/24/using-hudson-php-simpletest

Overview

This has been adopted from: jamieonsoftware

With help from: John S. - http://github.com/juven14

Design From: Istvan Pusztai - http://codeigniter.com/forums/viewthread/129253/P10/#697201

Installation

The unit_test.php file should go in your CodeIgniter root. The same place as index.php

You should open that file and alter your paths at the top.

The tests directory can be moved any where you want but they are setup to be in the root as well.

All test files need to be named test_name_folder.php. For example:

test_whatever_bug.php
test_string_helper.php
test_auth_library.php
test_core_model.php

I have included a full download of simpletest and the only customization I have made is to the simpletest/extensions/my_reporter.php.

Usage:

Once you have installed you can either run tests through the browser or via command line.

  • Browser - Visit yoursite.com/unit_test.php
  • Command Link - $ php unit_test.php
  • XML Results - $ php unit_test_xml.php

NOTES:

Inside the "tests" directory I include two example test files. The test_users_model.php will not run on its own because your application would not include the same users model as the example file. It is supplied just as a guide.

This version is now compatible with PHP 5.3

Credits

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.