Skip to content

eduardofg87/lets-tdd-a-simple-app

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
app
 
 
 
 
 
 
 
 
 
 
 
 

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