Download the PHP package joefallon/kisstest without Composer

On this page you can find all versions of the php package joefallon/kisstest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kisstest

KissTest

By Joe Fallon

A Keep-It-Simple-Straightforward, fast, and beautiful xUnit style unit test library.

Here is an example of some passing tests:

KissTest Passing Tests

It provides several useful features and benefits not available in other unit testing frameworks:

Here is an example containing some failing tests with some useful features annotated:

KissTest Passing Tests

Installation

The easiest way to install KissTest is with Composer. Create the following composer.json file and run the php composer.phar install command to install it.

Configuration and Test Setup

Directory Structure

Since KissTest uses just PHP for configuration there are an infinite number of ways to configure and set up a test suite. The following method is simple and straight forward.

Here is an example directory structure structure:

Here is the directory for KissTest:

KissTest Passing Tests

Here we see where the source (a.k.a. "src") directory and "tests" directory and additional (optional) configuration file is created:

KissTest Passing Tests

Here we see that the directory structure of the source code subtree and the unit test code subtree mirrors each other:

KissTest Passing Tests

Here we see the index.php file that defines the tests included in the test suite, a unit test file and the associated production code file:

KissTest Passing Tests

Test Suite Specification (tests/index.php)

The test specification exists within the index.php file. Here is an example:

Additional Configuration (tests/config/main.php)

The configuration file (tests/config/main.php) is where the following is placed:

Here is an example configuration file:

Class Documentation

Only two classes are needed for all unit testing needs. The first is UnitTest and the second is Mock. UnitTest is a class that all unit testing classes inherit from and that also contains all of the test cases. Mock is a class that is used for all stubbing and all mocking. No other classes from the unit testing framework are needed.

UnitTest

When using the class UnitTest, a few rules need to be followed:

Example Unit Test Class

Here is an example unit test class:

Assertion Methods in UnitTest

The following assertion methods are available in the base class UnitTest:

Test Not Implemented

Sometimes, a test method is created but the test method body has not been completed. In this case the method notImplementedFail() should be used.

Here is an example of using notImplementedFail():

Test Setup and Teardown

Sometimes a certain set of tasks will need to be performed every time a test is ran and another set of tasks will need to be performed every time a test completes. For example, perhaps an object graph needs to be created and then torn down and it is used in every test. The empty methods (i.e. hooks) setUp() and tearDown() are exactly for this purpose.

Here is an example of the test case setup and tear down:

Testing for Exceptions

Testing for exceptions is very easy. Here is an example of testing for an exception:

Mock

Mock is an extremely simple to understand and extremely fast stubbing and mocking solution. All types of mocking and stubbing needs can be satisfied via its use.

The use of Mock requires the cooperation of three different classes:

  1. The class under test.
  2. The unit test class that contains the methods for testing the class under test.
  3. The mock/stub (the same class satisfies both needs) class for the class under test.

Here is an example class under test:

Here is the class that will be mocked out:

Here is the class DependencyClass fully mocked/stubbed out:

Finally, here is the unit test that ties it all together:

The mocks can be used as stubs by simply not asserting on any of the methods in the instance of Mock held by the mock.stub class. Since no reflection, eval, or injection is used, the mock/stub classes are extremely fast.


All versions of kisstest with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package joefallon/kisstest contains the following files

Loading the files please wait ....