/** * Processes the form and shows which values are correct and which are incorrect. * * Expected GET variables: * - table - name of the table to load * * Expected POST variables: * - text - the submitted table data */ public function action_create() { if ($_SERVER['REQUEST_METHOD'] !== 'POST') { $this->action_new(); return; } $this->table = $this->loadTable($_GET['table']); $differ = new Differ(); $this->diff = $differ->diff($this->table->getText(), $_POST['text']); require_once './app/views/table/create.php'; }
/** * @covers SebastianBergmann\Diff\Differ::diff */ public function testCustomHeader() { $differ = new Differ('CUSTOM HEADER'); $this->assertEquals("CUSTOM HEADER@@ @@\n-a\n+b\n", $differ->diff('a', 'b')); }