eduardofg87 / lets-tdd-a-simple-app
A simple PHP project to learn TDD
dev-master
2019-06-07 10:56 UTC
Requires
- php: >=7.1.0
Requires (Dev)
- phpunit/phpunit: ^7
This package is not auto-updated.
Last update: 2024-09-22 10:50:31 UTC
README
A simple PHP project to learn TDD
My post in Medium about the code
Introduction
Your task is to build Class called Wrapper and its method called wrap.
Task definition:
You have to implement all tasks to pass all tests.
tasks:
- implement testItShouldWrapAnEmptyString
- implement testDoesNotWrapAShorterThanMaxCharsWord
- implement testItWrapsAWordSeveralTimesIfItsTooLong
- implement testItWrapsTwoWordsWhenSpaceAtTheEndOfLine
- implement testItWrapsTwoWordsWhenLineEndIsAfterFirstWord
- implement testItWraps3WordsOn2Lines
- implement testItWraps2WordsOn3Lines
- implement testItWraps2WordsAtBoundry
- create new class named Wrapper
Installation
git clone https://github.com/eduardofg87/lets-tdd-a-simple-app
cd lets-tdd-a-simple-app
composer install
EXTRA:
keep track of the history of encoded words in a local storage.
Hints
Think about how to prevent invalid inputs from being passed to the algorithms.
test
to run the tests run the command: ./vendor/bin/phpunit ./tests/FirstTest