You Are Here: Home Documentation Code Snippets

Enhance PHP Unit Testing And Mocking Framework improve the quality

Code Snippets

The code snippets section contains lots of short examples, so if you want to know how to create an expectation, call an assert or make use of the proxy for method coverage reports, this is the place for you.

Fakes! Using Mocks and Stubs

Collectively known as "fakes", mocks and stubs are very similar, differing only in why you need them. If you just need a fake class in order to make a test run you probably need a stub. If you want a test that checks that you are calling a method on a class with the correct arguments, you will want a mock.

Enhance PHP uses the same syntax for mocks and stubs, which makes it really easy to use them in your tests.

More coming soon - tell us what you want ! Honestly - we listen... we respond... we care!