Skip to content

eduardofg87/lets-tdd-a-simple-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Let's TDD a Simple App in PHP

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

Misc

About

A simple PHP project to learn TDD

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages