/** * inserted_rows test * * @dataProvider providerInsertedRows */ public function testInsertedRows($rows, $output) { $this->object = new PMA_Message(); $msg = $this->object->inserted_rows($rows); echo $this->object->addMessage($msg); $this->expectOutputString($output); $this->object->display(); }
PMA_relationsCleanupColumn($db, $table, $dropped_column); // to refresh the list of indexes (Ajax mode) $extra_data['indexes_list'] = PMA_Index::getView($table, $db); } // end if column was dropped } // end else "didn't ask to see php code" // No rows returned -> move back to the calling page if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) { if ($is_delete) { $message = PMA_Message::deleted_rows($num_rows); } elseif ($is_insert) { if ($is_replace) { /* For replace we get DELETED + INSERTED row count, so we have to call it affected */ $message = PMA_Message::affected_rows($num_rows); } else { $message = PMA_Message::inserted_rows($num_rows); } $insert_id = PMA_DBI_insert_id(); if ($insert_id != 0) { // insert_id is id of FIRST record inserted in one insert, so if we inserted multiple rows, we had to increment this $message->addMessage('[br]'); // need to use a temporary because the Message class // currently supports adding parameters only to the first // message $_inserted = PMA_Message::notice(__('Inserted row id: %1$d')); $_inserted->addParam($insert_id + $num_rows - 1); $message->addMessage($_inserted); } } elseif ($is_affected) { $message = PMA_Message::affected_rows($num_rows);
} $last_message = PMA_Message::notice(__('Inserted row id: %1$d')); $last_message->addParam($insert_id); $last_messages[] = $last_message; } PMA_DBI_free_result($result); } // end if foreach (PMA_DBI_get_warnings() as $warning) { $warning_messages[] = PMA_Message::sanitize($warning['Level'] . ': #' . $warning['Code'] . ' ' . $warning['Message']); } unset($result); } unset($single_query, $query); if ($is_insert && count($value_sets) > 0) { $message = PMA_Message::inserted_rows($total_affected_rows); } else { $message = PMA_Message::affected_rows($total_affected_rows); } $message->addMessages($last_messages, '<br />'); if (!empty($warning_messages)) { $message->addMessages($warning_messages, '<br />'); $message->isError(true); } if (!empty($error_messages)) { $message->addMessages($error_messages); $message->isError(true); } unset($error_messages, $warning_messages, $total_affected_rows, $last_messages, $last_message); if ($GLOBALS['is_ajax_request'] == true) { /**