PHP Classes

File: readme.md

Recommend this page to a friend!
  Classes of DeGraciaMathieu   Dummy Stub Spy Mock   readme.md   Download  
File: readme.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Dummy Stub Spy Mock
Demonstrate different types of PHP code tests
Author: By
Last change:
Date: 8 days ago
Size: 776 bytes
 

Contents

Class file image Download

Dummy vs Stub vs Spy vs Mock

image

The "System under test" (SUT) refers to the class being tested.

  • Dummy: facilitates the instantiation of the SUT
  • Stub: manipulates the indirect inputs of the SUT
  • Spy and Mock: control and verify the indirect outputs of the SUT

Indirect inputs refer to the information that the SUT needs to function which cannot be supplied through its signature.

Indirect outputs refer to the information that cannot be verified through the signature provided.

image