2017 © Pedro Peláez
 

library yahoo-weater-kata

Kata YahooWeater

image

jlsangon/yahoo-weater-kata

Kata YahooWeater

  • Friday, May 23, 2014
  • by casg23
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

kata/php

PHP skeleton for doing coding katas

Code Kata is a term coined by Dave Thomas, co-author of the book The Pragmatic Programmer, in a bow to the Japanese concept of kata in the martial arts. A code kata is an exercise in programming which helps a programmer hone their skills through practice and repetition. As of October 2011, Dave Thomas has published 21 different katas., (*1)

You can find some to start practicing here., (*2)

When you do programming katas, you use TDD. That's why I have included PHPUnit, Mockery, PHPSpec and Prophecy as composer dependencies. Choose the testing framework you feel more comfortable (or play with both)., (*3)

Practicing a kata

Let's imagine you want to practice "Bowling game kata". Details about this kata can be found here., (*4)

You will need composer., (*5)

curl -sS https://getcomposer.org/installer | php

Then, use "create-project" command to clone this project as a template and create a new one in your computer., (*6)

php composer.phar create-project kata/php bowling-kata dev-master

Then add your classes to 'src/Kata' and your test cases to 'src/Kata/Tests' and run 'php bin/phpunit' to run your tests., (*7)

php bin/phpunit

TestCase examples

If you run 'php bin/phpunit' you will see the following output., (*8)

PHPUnit 3.8-gc4f2bcd by Sebastian Bergmann.

Configuration read from /Users/carlosbuenosvinos/Documents/Web/bowling/phpunit.xml

...

Time: 91 ms, Memory: 1.75Mb
OK (3 tests, 3 assertions)

That's because you will find one class and its TestCase in the project in order to help you. You can delete them., (*9)

Adder is a class that adds two numbers and AdderTest tests that., (*10)

The Versions