2017 © Pedro Peláez
 

library tdd-workshop

image

phphooligans/tdd-workshop

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

🏫 PhpHooligans Workshop - Unit-Testing - The Basics 🎓

Introduction

This workshop is a first introductory course to isolated automated checks (also known as unit-testing). It is geared towards explaining how to create and run automated checks on a PHP code-base with PhpUnit., (*1)

After a short theoretical introduction, participants will gain the knowledge and ability to create unit-tests, and run them on a local or remote environment (such as build/CI server)., (*2)

Overview

The workshop is structured as follows:, (*3)

Preparation:

  • Make sure PHP + Xdebug is installed and correctly configured
  • Open the PhpUnit manual

Theory

A brief introduction on what automated checks are and how they work, (*4)

  1. What is an automated check?
  2. What is an automated check not? (i.e. exploratory)
  3. How do automated checks work?
  4. Various benefits
  5. A word on xUnit
  6. Testing old Code vs. Checking new Code

Practice

  1. Installing PHPUnit
    • Globally
    • Per project
    • Using different versions (using phpunit.phar)
  2. Pick a project to use for testing (or use the WordWrapper example from PHPHOOLIGANS/workshop-unit-testing)
  3. Basic Configuration
    • Commandline options
      • --configuration
    • Local configuration file (phpunit.xml) -- <testsuites>
    • Project configuration file (phpunit.xml.dist)
  4. Where do the tests go? (Directory structure, Namespaces and Autoloading)
  5. Creating an empty automated check
    • Pick (or create) a class to test
    • Creating a Test class
    • Creating an automated check
  6. Running automated checks
  7. Creating an actual automated check
  8. Using Asserts to validate assumptions

Follow-up Intermediate workshops

Once the basics are under control, developers might want to learn more features that PHPUnit offers. There is a workshop aimed at intermediate knowledge., (*5)

  1. Configuring the IDE or text-editor. Supported options are: a. PhpStorm b. Atom c. Vim d. Sublime e. Other editor (an external tools is used)
  2. Providing data to tests using DataProviders
  3. Using test doubles
  4. Setting up test dependencies
  5. More configuration
    • Strictness
      • forceCoversAnnotation="true"
    • <logging>
      • TestDox
      • Coverage Text
      • Coverage Clover XML
    • <filter>
  6. Code Coverage
    • Adding annotation @coversDefaultClass and @covers

Follow-up Advanced workshops

There more advanced or topic-specific workshops beyond the knowledge the intermediate workshop offers:, (*6)

/EOF/, (*7)

The Versions

16/03 2017

dev-master

9999999-dev https://workshop-php-tdd.herokuapp.com

  Sources   Download

GPL-3.0+

The Requires

 

tdd testing workshop unit-testing potherca test-driven phphooligans

31/10 2016

v0.1.1

0.1.1.0 https://workshop-php-tdd.herokuapp.com

  Sources   Download

GPL-3.0+

The Requires

 

tdd testing workshop unit-testing potherca test-driven phphooligans

31/10 2016

v0.1.0

0.1.0.0 https://workshop-php-tdd.herokuapp.com

  Sources   Download

GPL-3.0+

The Requires

 

tdd testing workshop unit-testing potherca test-driven phphooligans