Skip to content

meetmatt/partial-mock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHPUnit partial mock test lab

About

This is a test lab for PHPUnit's ability of partial mocks.

Overview

A partial mock is simply a pattern to alleviate a specific problem in testing with mock objects, that of getting mock objects into tight corners.

This test case validates PHPUnit's ability to do so. SUT contains two methods, one of which needs to be tested. However second method creates an unnecessary overhead for this test case and thus has to be mocked in order to isolate the SUD from side-effects and to separate test case's concerns.

Dependencies

This project requires following software:

Tested with

This project was tested with the following versions of software:

  • PHP 7.0.13
  • PHPUnit 5.7.15

Installation

Installs composer dependencies:

$ composer install

Usage

Run tests to verify PHPUnit features:

$ ./vendor/bin/phpunit --bootstrap vendor/autoload.php ./test

Contribution

Feel free to send PR's, but I feel really sorry for you if you have nothing to do else.

Guidelines:

  • PSR-4 for SUD classes under Acme namespace in src directory.
  • PSR-4 for test case classes under Acme\Test namespace in test directory.

License

Licensed under MIT License.

About

PHPUnit partial mock test lab

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages