Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Writing for the Test1:12 with Alena Holligan
Writing for the Test
We were expecting esttay but instead, we just got test.
Look at the code to convert our word.
We'll start by getting the first letter.
Word starting at zero and giving us the first character.
Then we'll want to start a new word.
This is going to equal the old word, starting after the first character.
Now, we can add the first letter to the end of our new word,
And also the string ay.
Now, instead of $word, we want to return $newWord.
And let's run our test again.
Great, this time it passes.
This doesn't cover all cases for PigLatin conversion, so
let's add these additional features starting with our tests.
You need to sign up for Treehouse in order to download course files.Sign up