assertEquals([' '], $acc->getLines()); } /** * @return array * - Expected array of lines from getLines(). * - Array of strings for the $words parameter to addWords(). * - String tag for the $tag parameter to addWords(). */ public function provideAddWords() { return [ [['wordword2'], ['word', 'word2'], 'tag'], [['word', 'word2'], ['word', "\nword2"], 'tag'], [[' ', 'word2'], ['', "\nword2"], 'tag'], ]; } /** * @covers ::addWords * @dataProvider provideAddWords */ public function testAddWords($expected, $words, $tag) { $acc = new HWLDFWordAccumulator(); $acc->addWords($words, $tag); $this->assertEquals($expected, $acc->getLines()); } }