Hands on PHPSpec

Miro Svrtan

@msvrtan

Software design/architecture

  • simple design
  • inspire confidence

Test Driven Development

Test Driven Development

Source: https://github.com/dwyl/learn-tdd

Check out 'Uncle Bob' doing TDD

  Robert Martin: The Transformation Priority Premise
   https://www.youtube.com/watch?v=B93QezwTQpI

Test First Development

Behavior Driven Development

  • specBDD vs storyBDD

PHPSpec

  • specBDD
  • generates files/code
  • highly opinionated

Dependency injection

Value object

SOLID

  • S - Single responsibility principle
  • O - Open/closed principle
  • L - Liskov substitution principle
  • I - Interface segregation principle
  • D - Dependency inversion principle

Test doubles

  • dummy
  • stub
  • spy
  • mock
  • fake

More about ...

Konstantin Kudryashov (everzet)

Design How Your Objects Talk Through Mocking at Laracon EU 2014
https://www.youtube.com/watch?v=X6y-OyMPqfw

Lets code

Made with Slides.com