Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Encourage TDD with PHP-VCR

Encourage TDD with PHP-VCR

Test First Approach with PHP-VCR

Ryo Tomidokoro

February 27, 2019
Tweet

More Decks by Ryo Tomidokoro

Other Decks in Programming

Transcript

  1. Replace API-Request to PHP-VCR -> Easy way to tests HTTP

    Request. -> Faster than actual HTTP Request.
  2. A chiken or egg situation - Loosely coupled architecture is

    desirable - Legacy app have a long way to achieve it
  3. Yes

  4. Create tests for the legacy app with PHP-VCR It’s will

    support your refactoring until you achive your desirable architecture.
  5. When refactoring ends - You can choose wheather to use

    Mock or PHP-VCR - PHP-VCR is a great tool guiding you to achieve a better software architecture.
  6. Headers match may be too strict Development environment & CI

    environment might use slightly diffrent version of UserAgent. Ignore strict headers match at this situation.
  7. Summary PHP-VCR allows you to write tests for legacy Apps.

    Use ‘Test Fast’ approach to improve the software architecture