Test-driven development with PHPUnit

Test-driven development with PHPUnit

610644ae9328059c33a272d08b90c75d?s=128

Oliver Klee

June 23, 2018
Tweet

Transcript

  1. 2.

    This is Oliver Klee (me!) Workshop teacher •unit testing •extension

    development •software quality •saying „no“, consent culture TYPO3 extension
 developer (wanna-be)
 singer @oliklee oliverklee oliverklee.de
  2. 25.

    The life cycle of a test new FooTest(); setUp(); /**

    @test */ lifeIsGood(); tearDown();
  3. 26.

    4 test phases set up setUp()
 code in the test

    method exercise method call verify assert…() tear down tearDown()
  4. 30.
  5. 49.

    Use meaningful test names classCanBeInstantiated setTitleSetsTitle setSizeWithZeroThrowsException hasTitleForEmptyTitleReturnsFalse Name the

    behavior. Name the preconditions. Name the method. Don’t use
 “works” or
 “works correctly”. measureFrubbleWorksCorrectly
  6. 50.
  7. 53.