/** * @dataProvider provider_getChangeSet */ public function testGetChangeSet($message, array $expect, $leftText, $rightText) { $changeSet = EchoDiscussionParser::getMachineReadableDiff($leftText, $rightText); unset($changeSet['_info']); $this->assertEquals($expect, $changeSet, $message); }
/** * @dataProvider provider_detectSectionTitleAndText */ public function testdetectSectionTitleAndText($message, $expect, $format, $name) { // str_replace because we want to replace multiple instances of '%s' with the same valueA $before = str_replace('%s', '', $format); $after = str_replace('%s', self::signedMessage($name), $format); $diff = EchoDiscussionParser::getMachineReadableDiff($before, $after); $interp = EchoDiscussionParser::interpretDiff($diff, $name); // There should be a section-text only if there is section-title $expectText = $expect ? self::message($name) : ''; $this->assertEquals(array('section-title' => $expect, 'section-text' => $expectText), EchoDiscussionParser::detectSectionTitleAndText($interp, $message)); }