/** * @ test */ function shouldThrowInvalidArgumentExceptionAlternative() { // TODO expect "InvalidArgumentException" $counter = new WordCounter("green bar green"); $counter->ratioOf("anotherMissingWord"); }
/** * @ test * TODO take data from tableData method */ function shouldReturnRatioOfGivenWord($sentence, $word, $expectedRratio) { $counter = new WordCounter($sentence); $this->assertEquals($expectedRratio, $counter->ratioOf($word), '', 0.01); }