Git
Threads by month
- ----- 2025 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
July 2011
- 6 participants
- 320 discussions

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-11710-g11937b0
by Michal Čihař 22 Jul '11
by Michal Čihař 22 Jul '11
22 Jul '11
The branch, master has been updated
via 11937b06bd1bffc24cacd0f45d2ce749387c4574 (commit)
via 5f9c187010dcf2b51bf3dee516789b6fae9f2363 (commit)
from 4a80c3e62d070d18ce12cc9bcf29d753e3eecef1 (commit)
- Log -----------------------------------------------------------------
commit 11937b06bd1bffc24cacd0f45d2ce749387c4574
Merge: 4a80c3e62d070d18ce12cc9bcf29d753e3eecef1 5f9c187010dcf2b51bf3dee516789b6fae9f2363
Author: Michal Čihař <mcihar(a)suse.cz>
Date: Fri Jul 22 15:19:59 2011 +0200
Merge remote-tracking branch 'origin/QA_3_4'
-----------------------------------------------------------------------
Summary of changes:
setup/lib/index.lib.php | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/setup/lib/index.lib.php b/setup/lib/index.lib.php
index 04fdfd1..9823cbd 100644
--- a/setup/lib/index.lib.php
+++ b/setup/lib/index.lib.php
@@ -264,7 +264,7 @@ function perform_config_checks()
$strLoginCookieValidityWarning3 = __('If using cookie authentication and %sLogin cookie store%s is not 0, %sLogin cookie validity%s must be set to a value less or equal to it.');
$strLoginCookieValidityWarning3 = sprintf($strLoginCookieValidityWarning3, '[a@?page=form&formset=Features#tab_Security]', '[/a]', '[a@?page=form&formset=Features#tab_Security]', '[/a]');
$strSecurityInfoMsg = __('If you feel this is necessary, use additional protection settings - %shost authentication%s settings and %strusted proxies list%s. However, IP-based protection may not be reliable if your IP belongs to an ISP where thousands of users, including you, are connected to.');
- $strSecurityInfoMsg = sprintf($strSecurityInfoMsg, '[a@?page=servers&mode=edit&id=%1$d#tab_Server_config]', '[/a]', '[a@?page=form&formset=Features#tab_Security]', '%s');
+ $strSecurityInfoMsg = sprintf($strSecurityInfoMsg, '[a@?page=servers&mode=edit&id=%1$d#tab_Server_config]', '[/a]', '[a@?page=form&formset=Features#tab_Security]', '[/a]');
$strServerAuthConfigMsg = __('You set the [kbd]config[/kbd] authentication type and included username and password for auto-login, which is not a desirable option for live hosts. Anyone who knows or guesses your phpMyAdmin URL can directly access your phpMyAdmin panel. Set %sauthentication type%s to [kbd]cookie[/kbd] or [kbd]http[/kbd].');
$strServerAuthConfigMsg = sprintf($strServerAuthConfigMsg, '[a@?page=servers&mode=edit&id=%1$d#tab_Server]', '[/a]');
$strZipDumpExportWarning = __('%sZip compression%s requires functions (%s) which are unavailable on this system.');
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, QA_3_4, updated. RELEASE_3_4_3_1-38-g5f9c187
by Michal Čihař 22 Jul '11
by Michal Čihař 22 Jul '11
22 Jul '11
The branch, QA_3_4 has been updated
via 5f9c187010dcf2b51bf3dee516789b6fae9f2363 (commit)
from 54398f8a124702e30820bc4636040dda1db6b71b (commit)
- Log -----------------------------------------------------------------
commit 5f9c187010dcf2b51bf3dee516789b6fae9f2363
Author: Jørgen Thomsen <joergent(a)users.sourceforge.neT>
Date: Fri Jul 22 15:19:31 2011 +0200
Fix format parameters
-----------------------------------------------------------------------
Summary of changes:
setup/lib/index.lib.php | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/setup/lib/index.lib.php b/setup/lib/index.lib.php
index aa0d044..149918c 100644
--- a/setup/lib/index.lib.php
+++ b/setup/lib/index.lib.php
@@ -264,7 +264,7 @@ function perform_config_checks()
$strLoginCookieValidityWarning3 = __('If using cookie authentication and %sLogin cookie store%s is not 0, %sLogin cookie validity%s must be set to a value less or equal to it.');
$strLoginCookieValidityWarning3 = sprintf($strLoginCookieValidityWarning3, '[a@?page=form&formset=Features#tab_Security]', '[/a]', '[a@?page=form&formset=Features#tab_Security]', '[/a]');
$strSecurityInfoMsg = __('If you feel this is necessary, use additional protection settings - %shost authentication%s settings and %strusted proxies list%s. However, IP-based protection may not be reliable if your IP belongs to an ISP where thousands of users, including you, are connected to.');
- $strSecurityInfoMsg = sprintf($strSecurityInfoMsg, '[a@?page=servers&mode=edit&id=%1$d#tab_Server_config]', '[/a]', '[a@?page=form&formset=Features#tab_Security]', '%s');
+ $strSecurityInfoMsg = sprintf($strSecurityInfoMsg, '[a@?page=servers&mode=edit&id=%1$d#tab_Server_config]', '[/a]', '[a@?page=form&formset=Features#tab_Security]', '[/a]');
$strServerAuthConfigMsg = __('You set the [kbd]config[/kbd] authentication type and included username and password for auto-login, which is not a desirable option for live hosts. Anyone who knows or guesses your phpMyAdmin URL can directly access your phpMyAdmin panel. Set %sauthentication type%s to [kbd]cookie[/kbd] or [kbd]http[/kbd].');
$strServerAuthConfigMsg = sprintf($strServerAuthConfigMsg, '[a@?page=servers&mode=edit&id=%1$d#tab_Server]', '[/a]');
$strZipDumpExportWarning = __('%sZip compression%s requires functions (%s) which are unavailable on this system.');
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-11708-g4a80c3e
by Michal Čihař 22 Jul '11
by Michal Čihař 22 Jul '11
22 Jul '11
The branch, master has been updated
via 4a80c3e62d070d18ce12cc9bcf29d753e3eecef1 (commit)
via 54398f8a124702e30820bc4636040dda1db6b71b (commit)
from c8967b62309eb6df7042fd44848042cd7f9d8d40 (commit)
- Log -----------------------------------------------------------------
commit 4a80c3e62d070d18ce12cc9bcf29d753e3eecef1
Merge: c8967b62309eb6df7042fd44848042cd7f9d8d40 54398f8a124702e30820bc4636040dda1db6b71b
Author: Michal Čihař <mcihar(a)suse.cz>
Date: Fri Jul 22 15:17:25 2011 +0200
Merge remote-tracking branch 'origin/QA_3_4'
-----------------------------------------------------------------------
Summary of changes:
libraries/display_tbl.lib.php | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index 9e02c24..af5dc89 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -2078,7 +2078,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|| $analyzed_sql[0]['where_clause'] == '1 ')) {
// "j u s t b r o w s i n g"
$pre_count = '~';
- $after_count = PMA_showHint(PMA_sanitize(__('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]')), true);
+ $after_count = PMA_showHint(PMA_sanitize(__('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]')));
} else {
$pre_count = '';
$after_count = '';
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, QA_3_4, updated. RELEASE_3_4_3_1-37-g54398f8
by Michal Čihař 22 Jul '11
by Michal Čihař 22 Jul '11
22 Jul '11
The branch, QA_3_4 has been updated
via 54398f8a124702e30820bc4636040dda1db6b71b (commit)
from bea5556023b4561c23e82f5005059c5fb7b1cde8 (commit)
- Log -----------------------------------------------------------------
commit 54398f8a124702e30820bc4636040dda1db6b71b
Author: Sven Strickroth <email(a)cs-ware.de>
Date: Fri Jul 22 02:01:17 2011 +0200
Do not call PMA_showHint with bbcode=true in display_tbl.lib.php
This fixes an issue with an InnoDB-table on sql.php with "select * from tbl" showing that "total ~ N <sup>1</sup>" rows are displayed and with a JavaScript enabled browser the footnote gets hidden and it's impossible to find out what the <sup>1</sup> means.
Signed-off-by: Sven Strickroth <email(a)cs-ware.de>
-----------------------------------------------------------------------
Summary of changes:
libraries/display_tbl.lib.php | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index c7d74ef..c871612 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -1937,7 +1937,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|| $analyzed_sql[0]['where_clause'] == '1 ')) {
// "j u s t b r o w s i n g"
$pre_count = '~';
- $after_count = PMA_showHint(PMA_sanitize(__('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]')), true);
+ $after_count = PMA_showHint(PMA_sanitize(__('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]')));
} else {
$pre_count = '';
$after_count = '';
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-11706-gc8967b6
by Michal Čihař 22 Jul '11
by Michal Čihař 22 Jul '11
22 Jul '11
The branch, master has been updated
via c8967b62309eb6df7042fd44848042cd7f9d8d40 (commit)
from 2dee226c5010cc9dd3f3ca85ac7138af61a24358 (commit)
- Log -----------------------------------------------------------------
commit c8967b62309eb6df7042fd44848042cd7f9d8d40
Author: M. Quasar <marcosm(a)gmail.com>
Date: Wed Jul 20 16:08:01 2011 -0300
added translation strings for missing values
-----------------------------------------------------------------------
Summary of changes:
po/pt_BR.po | 69 ++++++++++++++++++++++++++++++----------------------------
1 files changed, 36 insertions(+), 33 deletions(-)
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 20fc437..a3d4cb1 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -10194,7 +10194,7 @@ msgstr "Aplicar mudanças selecionadas"
#: server_synchronize.php:446 server_synchronize.php:891
msgid "Synchronize Databases"
-msgstr ""
+msgstr "Sincronizar Bando de Dados"
#: server_synchronize.php:459
msgid "Selected target tables have been synchronized with source tables."
@@ -10234,7 +10234,7 @@ msgstr ""
#: server_variables.php:58
msgid "Setting variable failed"
-msgstr ""
+msgstr "Erro na atribuição da variável"
#: server_variables.php:77
msgid "Server variables and settings"
@@ -10268,18 +10268,20 @@ msgstr ""
msgid ""
"You are not using a secure connection; all data (including potentially "
"sensitive information, like passwords) is transferred unencrypted!"
-msgstr ""
+msgstr "Você não está usando conexão segura; todos dados (incluindo "
+possíveis informações sensíveis, como senhas) são transferidos sem criptografia."
#: setup/frames/index.inc.php:60
#, php-format
msgid ""
"If your server is also configured to accept HTTPS requests follow [a@%s]this "
"link[/a] to use a secure connection."
-msgstr ""
+msgstr "Se o seu servidor também está configurado para aceitar requisições HTTPS "
+siga [a@%s]este link[/a] para usar uma conexão segura."
#: setup/frames/index.inc.php:64
msgid "Insecure connection"
-msgstr "Conexão insegura"
+msgstr "Conexão vulnerável"
#: setup/frames/index.inc.php:92
#, fuzzy
@@ -10383,7 +10385,8 @@ msgstr ""
msgid ""
"Reading of version failed. Maybe you're offline or the upgrade server does "
"not respond."
-msgstr ""
+msgstr "Leitura de versão falhou. Você pode estar offline ou o servidor "
+"de atualização não responde."
#: setup/lib/index.lib.php:143
msgid "Got invalid version string from server"
@@ -10398,11 +10401,12 @@ msgstr ""
msgid ""
"You are using Git version, run [kbd]git pull[/kbd] :-)[br]The latest stable "
"version is %s, released on %s."
-msgstr ""
+msgstr "Se você estiver usando versão do Gir, execute [kbd]git pull[/kbd] :-)[br]"
+"A versão estável mais nova é %s, lançada em %s."
#: setup/lib/index.lib.php:165
msgid "No newer stable version is available"
-msgstr ""
+msgstr "Não existe nenhuma versão estável mais nova."
#: setup/lib/index.lib.php:250
#, php-format
@@ -10431,12 +10435,13 @@ msgstr ""
msgid ""
"This value should be double checked to ensure that this directory is neither "
"world accessible nor readable or writable by other users on your server."
-msgstr ""
+msgstr "Este valor deve ser verificado com atenção para garantir que "
+"este diretório não seja acessado ou escrito por outros usuários no seu servidor."
#: setup/lib/index.lib.php:256
#, php-format
msgid "This %soption%s should be enabled if your web server supports it."
-msgstr ""
+msgstr "Esta %sopção%s deveria estar habilitada se seu navegador tem suporter."
#: setup/lib/index.lib.php:258
#, php-format
@@ -10518,7 +10523,7 @@ msgstr "Você permite a conexão com o servidor sem uma senha."
#: setup/lib/index.lib.php:351
msgid "Key is too short, it should have at least 8 characters."
-msgstr "A chave é muito curta, você deveria ter pelo menos 8 caracteres."
+msgstr "A chave é muito curta, deveria ter pelo menos 8 caracteres."
#: setup/lib/index.lib.php:358
msgid "Key should contain letters, numbers [em]and[/em] special characters."
@@ -10532,7 +10537,7 @@ msgstr "Visualizar valores estrangeiros"
#: sql.php:189
#, php-format
msgid "Using bookmark \"%s\" as default browse query."
-msgstr ""
+msgstr "Usando marcador \"%s\" como padrão."
#: sql.php:661 tbl_replace.php:369
#, php-format
@@ -10571,7 +10576,7 @@ msgstr "Por causa da sua largura,<br /> esse campo pode não ser editável"
#: tbl_change.php:800
msgid "Remove BLOB Repository Reference"
-msgstr ""
+msgstr "Remover referência a repositório BLOB"
#: tbl_change.php:806
msgid "Binary - do not edit"
@@ -10635,7 +10640,7 @@ msgstr "Mar"
#: tbl_chart.php:87
msgid "Line"
-msgstr ""
+msgstr "Linhas"
#: tbl_chart.php:88
#, fuzzy
@@ -10663,7 +10668,7 @@ msgstr "Título do Relatório"
#: tbl_chart.php:99
msgid "X-Axis:"
-msgstr ""
+msgstr "Eixo X"
#: tbl_chart.php:113
#, fuzzy
@@ -10717,7 +10722,7 @@ msgstr "Ver o esquema da tabela"
#: tbl_gis_visualization.php:111
msgid "Display GIS Visualization"
-msgstr ""
+msgstr "Mostrar visualização GIS"
#: tbl_gis_visualization.php:157
msgid "Width"
@@ -10978,7 +10983,8 @@ msgstr "Relações internas"
msgid ""
"An internal relation is not necessary when a corresponding FOREIGN KEY "
"relation exists."
-msgstr ""
+msgstr "Uma relação interna é desnecessária quando uma CHAVE ESTRANGEIRA "
+"correspondente existe."
#: tbl_relation.php:410
msgid "Foreign key constraint"
@@ -10996,7 +11002,7 @@ msgstr "Selecionar os campos (no mínimo 1)"
#: tbl_select.php:278
msgid "Add search conditions (body of the \"where\" clause):"
-msgstr "Condição de Pesquisa (complemento da cláusula \"onde\"):"
+msgstr "Condição de pesquisa (complemento da cláusula \"onde\"):"
#: tbl_select.php:285
msgid "Number of rows per page"
@@ -11008,7 +11014,7 @@ msgstr "Ordenado por:"
#: tbl_structure.php:158 tbl_structure.php:163 tbl_structure.php:611
msgid "Spatial"
-msgstr ""
+msgstr "Espacial"
#: tbl_structure.php:165 tbl_structure.php:169
msgid "Browse distinct values"
@@ -11106,22 +11112,22 @@ msgstr "particionado"
#: tbl_tracking.php:109
#, php-format
msgid "Tracking report for table `%s`"
-msgstr ""
+msgstr "Relatório de rastreamento para tabela `%s`"
#: tbl_tracking.php:182
#, php-format
msgid "Version %s is created, tracking for %s.%s is activated."
-msgstr ""
+msgstr "Versão %s criada, rastreamento para %s. %s ativado(a)."
#: tbl_tracking.php:190
#, php-format
msgid "Tracking for %s.%s , version %s is deactivated."
-msgstr ""
+msgstr "Rastreamento para %s.%s, versão %s desativado(a)."
#: tbl_tracking.php:198
#, php-format
msgid "Tracking for %s.%s , version %s is activated."
-msgstr ""
+msgstr "Rastreamento para %s.%s, versão %s ativado(a)."
#: tbl_tracking.php:208
msgid "SQL statements executed."
@@ -11131,7 +11137,8 @@ msgstr "Instruções SQL executadas."
msgid ""
"You can execute the dump by creating and using a temporary database. Please "
"ensure that you have the privileges to do so."
-msgstr ""
+msgstr "Você pode executar o dump criando e usando uma tabela temporária."
+"Por favor, certifique-se de ter os privilégios necessários."
#: tbl_tracking.php:215
msgid "Comment out these two lines if you do not need them."
@@ -11145,11 +11152,7 @@ msgstr "Instruções SQL exportadas. Por favor copie a saída ou execute."
#: tbl_tracking.php:255
#, php-format
msgid "Version %s snapshot (SQL code)"
-msgstr ""
-
-#: tbl_tracking.php:382
-msgid "Tracking data definition successfully deleted"
-msgstr ""
+msgstr "Instantâneo (código SQL) da versão %s"
#: tbl_tracking.php:384 tbl_tracking.php:401
#, fuzzy
@@ -11157,9 +11160,9 @@ msgstr ""
msgid "Query error"
msgstr "Reunir erros"
-#: tbl_tracking.php:399
+#: tbl_tracking.php:399 tbl_tracking.php:382
msgid "Tracking data manipulation successfully deleted"
-msgstr ""
+msgstr "Rastreamento de manipulação de dados removidos com sucesso"
#: tbl_tracking.php:411
msgid "Tracking statements"
@@ -11168,7 +11171,7 @@ msgstr "Rastreando instruções"
#: tbl_tracking.php:427 tbl_tracking.php:555
#, php-format
msgid "Show %s with dates from %s to %s by user %s %s"
-msgstr ""
+msgstr "Mostrar %s com datas desde %s até %s pelo usuário %s %s"
#: tbl_tracking.php:432
#, fuzzy
@@ -11300,7 +11303,7 @@ msgstr "Você não tem direitos suficientes para estar aqui agora!"
#: user_password.php:96
msgid "The profile has been updated."
-msgstr "O perfíl foi atualizado."
+msgstr "O perfil foi atualizado."
#: view_create.php:141
msgid "VIEW name"
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, unittesting, deleted. RELEASE_3_4_3_1-8161-gf787d74
by Herman van Rink 22 Jul '11
by Herman van Rink 22 Jul '11
22 Jul '11
The branch, unittesting has been deleted
was f787d74f1027d15f5817b4647d7d67085b9c1f3f
-----------------------------------------------------------------------
f787d74f1027d15f5817b4647d7d67085b9c1f3f Merge remote-tracking branch 'zarubin/master' into unittesting
-----------------------------------------------------------------------
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-11705-g2dee226
by Piotr Przybylski 22 Jul '11
by Piotr Przybylski 22 Jul '11
22 Jul '11
The branch, master has been updated
via 2dee226c5010cc9dd3f3ca85ac7138af61a24358 (commit)
via a7fe9db58180d429866bee77e5d0d27f913ed860 (commit)
from 8738697fb115b96fe7a686bf5fe28f0feda812a8 (commit)
- Log -----------------------------------------------------------------
commit 2dee226c5010cc9dd3f3ca85ac7138af61a24358
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Fri Jul 22 14:11:59 2011 +0200
Add missing HTML escaping
commit a7fe9db58180d429866bee77e5d0d27f913ed860
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Fri Jul 22 14:09:57 2011 +0200
Change strings
-----------------------------------------------------------------------
Summary of changes:
libraries/import.lib.php | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/libraries/import.lib.php b/libraries/import.lib.php
index f257205..54c9fc6 100644
--- a/libraries/import.lib.php
+++ b/libraries/import.lib.php
@@ -1066,15 +1066,15 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = null, &$additional_sql =
$message = '<br /><br />';
$message .= '<strong>' . __('The following structures have either been created or altered. Here you can:') . '</strong><br />';
- $message .= '<ul><li>' . __('View a structure`s contents by clicking on its name') . '</li>';
- $message .= '<li>' . __('Change any of its settings by clicking the corresponding "Options" link') . '</li>';
- $message .= '<li>' . __('Edit its structure by following the "Structure" link') . '</li>';
+ $message .= '<ul><li>' . __("View a structure's contents by clicking on its name") . '</li>';
+ $message .= '<li>' . htmlspecialchars(__('Change any of its settings by clicking the corresponding "Options" link')) . '</li>';
+ $message .= '<li>' . htmlspecialchars(__('Edit structure by following the "Structure" link')) . '</li>';
$message .= sprintf('<br /><li><a href="%s" title="%s">%s</a> (<a href="%s" title="%s">' . __('Options') . '</a>)</li>',
$db_url,
- __('Go to database') . ': ' . PMA_backquote($db_name),
- $db_name,
+ __('Go to database') . ': ' . htmlspecialchars(PMA_backquote($db_name)),
+ htmlspecialchars($db_name),
$db_ops_url,
- __('Edit') . ' ' . PMA_backquote($db_name) . ' ' . __('settings'));
+ __('Edit') . ' ' . htmlspecialchars(PMA_backquote($db_name)) . ' ' . __('settings'));
$message .= '<ul>';
@@ -1093,17 +1093,17 @@ function PMA_buildSQL($db_name, &$tables, &$analyses = null, &$additional_sql =
if (! PMA_isView($db_name, $tables[$i][TBL_NAME])) {
$message .= sprintf('<li><a href="%s" title="%s">%s</a> (<a href="%s" title="%s">' . __('Structure') . '</a>) (<a href="%s" title="%s">' . __('Options') . '</a>)</li>',
$tbl_url,
- __('Go to table') . ': ' . PMA_backquote($tables[$i][TBL_NAME]),
- $tables[$i][TBL_NAME],
+ __('Go to table') . ': ' . htmlspecialchars(PMA_backquote($tables[$i][TBL_NAME])),
+ htmlspecialchars($tables[$i][TBL_NAME]),
$tbl_struct_url,
- PMA_backquote($tables[$i][TBL_NAME]) . ' ' . __('structure'),
+ htmlspecialchars(PMA_backquote($tables[$i][TBL_NAME])) . ' ' . __('structure'),
$tbl_ops_url,
- __('Edit') . ' ' . PMA_backquote($tables[$i][TBL_NAME]) . ' ' . __('settings'));
+ __('Edit') . ' ' . htmlspecialchars(PMA_backquote($tables[$i][TBL_NAME])) . ' ' . __('settings'));
} else {
$message .= sprintf('<li><a href="%s" title="%s">%s</a></li>',
$tbl_url,
- __('Go to view') . ': ' . PMA_backquote($tables[$i][TBL_NAME]),
- $tables[$i][TBL_NAME]);
+ __('Go to view') . ': ' . htmlspecialchars(PMA_backquote($tables[$i][TBL_NAME])),
+ htmlspecialchars($tables[$i][TBL_NAME]));
}
}
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-11703-g8738697
by Michal Čihař 22 Jul '11
by Michal Čihař 22 Jul '11
22 Jul '11
The branch, master has been updated
via 8738697fb115b96fe7a686bf5fe28f0feda812a8 (commit)
via a03ba806136c7b0dab12bf962a5a7300296b00bb (commit)
via be6a44af7e0bb172a9df448af350f967e6baded9 (commit)
via c797818cdc8c0e822f981b48fbcae36b5b47b97c (commit)
via 5a59f2f427d1f5b3c60104558d3a2433419e440e (commit)
via 2ee25a31a26ba08c333f657b9f0bd784bda72300 (commit)
via 40187e2381aa6b32309ff423632249f9753ed5ad (commit)
via 9da30b2d8200601b148ee8ac5ea4987d366a7dda (commit)
from 8489f415c944a41524bfec1c8e388b0572958882 (commit)
- Log -----------------------------------------------------------------
commit 8738697fb115b96fe7a686bf5fe28f0feda812a8
Merge: 8489f415c944a41524bfec1c8e388b0572958882 a03ba806136c7b0dab12bf962a5a7300296b00bb
Author: Michal Čihař <mcihar(a)suse.cz>
Date: Fri Jul 22 13:39:29 2011 +0200
Merge remote-tracking branch 'pootle/master'
commit a03ba806136c7b0dab12bf962a5a7300296b00bb
Merge: be6a44af7e0bb172a9df448af350f967e6baded9 60fdffbafaa32ba629638894f42403d34b53de20
Author: Pootle server <pootle(a)cihar.com>
Date: Fri Jul 22 12:40:06 2011 +0200
Merge remote-tracking branch 'origin/master'
commit be6a44af7e0bb172a9df448af350f967e6baded9
Author: Domen <dbc334(a)gmail.com>
Date: Fri Jul 22 11:14:22 2011 +0200
Translation update done using Pootle.
commit c797818cdc8c0e822f981b48fbcae36b5b47b97c
Author: Domen <dbc334(a)gmail.com>
Date: Fri Jul 22 10:56:21 2011 +0200
Translation update done using Pootle.
commit 5a59f2f427d1f5b3c60104558d3a2433419e440e
Author: Domen <dbc334(a)gmail.com>
Date: Fri Jul 22 10:55:58 2011 +0200
Translation update done using Pootle.
commit 2ee25a31a26ba08c333f657b9f0bd784bda72300
Author: Domen <dbc334(a)gmail.com>
Date: Fri Jul 22 10:55:46 2011 +0200
Translation update done using Pootle.
commit 40187e2381aa6b32309ff423632249f9753ed5ad
Author: Domen <dbc334(a)gmail.com>
Date: Fri Jul 22 10:46:29 2011 +0200
Translation update done using Pootle.
commit 9da30b2d8200601b148ee8ac5ea4987d366a7dda
Author: Domen <dbc334(a)gmail.com>
Date: Fri Jul 22 10:45:36 2011 +0200
Translation update done using Pootle.
-----------------------------------------------------------------------
Summary of changes:
po/sl.po | 32 ++++++++++++++++++++++++++------
1 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/po/sl.po b/po/sl.po
index 9c8cb4b..f7742a3 100644
--- a/po/sl.po
+++ b/po/sl.po
@@ -4,15 +4,15 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 3.5.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel(a)lists.sourceforge.net\n"
"POT-Creation-Date: 2011-07-22 10:17+0200\n"
-"PO-Revision-Date: 2011-07-21 19:45+0200\n"
+"PO-Revision-Date: 2011-07-22 11:14+0200\n"
"Last-Translator: Domen <dbc334(a)gmail.com>\n"
"Language-Team: slovenian <sl(a)li.org>\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
-"%100==4 ? 2 : 3);\n"
+"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || "
+"n%100==4 ? 2 : 3);\n"
"X-Generator: Pootle 2.0.5\n"
#: browse_foreigners.php:35 browse_foreigners.php:53
@@ -1159,7 +1159,7 @@ msgstr "KiB"
#: js/messages.php:100
msgid "Average load"
-msgstr "Povprečno nalaganje"
+msgstr "Povprečna obremenitev"
#. l10n: Questions is the name of a MySQL Status variable
#: js/messages.php:102
@@ -9882,7 +9882,6 @@ msgid "Monitor Instructions"
msgstr "Navodila nadziranja"
#: server_status.php:1337
-#, fuzzy
#| msgid ""
#| "The phpMyAdmin Monitor can assist you in optimizing the server "
#| "configuration and track down time intensive\n"
@@ -9900,7 +9899,9 @@ msgstr ""
"Nadziranje phpMyAdmin vam lahko pomaga pri optimiziranju konfiguracije "
"strežnika in izsleditvi časovno zahtevnih\n"
" poizvedb. Za slednje morate nastaviti log_output na 'TABLE' in imeti "
-"ali slow_query_log ali general_log omogočeno."
+"ali slow_query_log ali general_log omogočeno. Vendar pomnite, da\n"
+" general_log ustvari ogromno podatkov in poveča obremenitev strežnika "
+"do 15 %."
#: server_status.php:1346
msgid ""
@@ -9916,6 +9917,18 @@ msgid ""
"statistics from the logs helping you find what caused the\n"
" activity spike.</p>"
msgstr ""
+"<b>Uporaba nadziranja:</b><br/>\n"
+" V redu, pripravljeni ste! Ko kliknete 'Začni nadziranje', se bo vaš "
+"brskalnik osvežil in prikazal grafikone\n"
+" v rednih razmikih. Dodajate lahko grafikone in spremenite pogostost "
+"osveževanja pod 'Nastavitve' ali pa\n"
+" odstranite kateri koli grafikon s klikom na ikono zobnika ob "
+"ustreznem grafikonu.\n"
+" <p>Ko opazite nenavadno povečanje dejavnosti, izberite ustrezno "
+"časovno obdobje na katerem koli grafikonu tako, da pridržite\n"
+" levi miškin gumb in kazalec povlečete čez grafikon. To bo naložilo "
+"statistike iz dnevnikov, kar vam bo pomagalo odkriti vzrok\n"
+" povečane dejavnosti.</p>"
#: server_status.php:1356
msgid ""
@@ -9927,6 +9940,13 @@ msgid ""
"not required any more.\n"
" "
msgstr ""
+"<b>Pomnite:</b>\n"
+" Omogočitev general_log lahko poveča obremenitev strežnika za 5–15 %. "
+"Zavedajte se tudi, da je ustvarjanje statistik iz dnevnikov\n"
+" zelo obremenjujoče opravilo, zato je priporočljivo, da izberete samo "
+"majhen časovni razpon ter onemogočite general_log in počistite njene "
+"tabele, ko nadziranja ne potrebujete več.\n"
+" "
#: server_status.php:1369
msgid "CPU Usage"
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-11695-g8489f41
by Rouslan Placella 22 Jul '11
by Rouslan Placella 22 Jul '11
22 Jul '11
The branch, master has been updated
via 8489f415c944a41524bfec1c8e388b0572958882 (commit)
from 60fdffbafaa32ba629638894f42403d34b53de20 (commit)
- Log -----------------------------------------------------------------
commit 8489f415c944a41524bfec1c8e388b0572958882
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Fri Jul 22 11:54:03 2011 +0100
Added unit tests for Routines, Triggers and Events
-----------------------------------------------------------------------
Summary of changes:
phpunit.xml.dist | 1 +
.../rte/PMA_EVN_getDataFromRequest_test.php | 104 +++
test/libraries/rte/PMA_EVN_getEditorForm_test.php | 445 ++++++++++
.../rte/PMA_EVN_getQueryFromRequest_test.php | 144 ++++
.../libraries/rte/PMA_RTN_ParameterParser_test.php | 163 ++++
.../rte/PMA_RTN_getDataFromRequest_test.php | 197 +++++
test/libraries/rte/PMA_RTN_getEditorForm_test.php | 885 ++++++++++++++++++++
test/libraries/rte/PMA_RTN_getExecuteForm_test.php | 244 ++++++
.../rte/PMA_RTN_getQueryFromRequest_test.php | 247 ++++++
.../rte/PMA_TRI_getDataFromRequest_test.php | 78 ++
test/libraries/rte/PMA_TRI_getEditorForm_test.php | 289 +++++++
.../rte/PMA_TRI_getQueryFromRequest_test.php | 103 +++
12 files changed, 2900 insertions(+), 0 deletions(-)
create mode 100644 test/libraries/rte/PMA_EVN_getDataFromRequest_test.php
create mode 100644 test/libraries/rte/PMA_EVN_getEditorForm_test.php
create mode 100644 test/libraries/rte/PMA_EVN_getQueryFromRequest_test.php
create mode 100644 test/libraries/rte/PMA_RTN_ParameterParser_test.php
create mode 100644 test/libraries/rte/PMA_RTN_getDataFromRequest_test.php
create mode 100644 test/libraries/rte/PMA_RTN_getEditorForm_test.php
create mode 100644 test/libraries/rte/PMA_RTN_getExecuteForm_test.php
create mode 100644 test/libraries/rte/PMA_RTN_getQueryFromRequest_test.php
create mode 100644 test/libraries/rte/PMA_TRI_getDataFromRequest_test.php
create mode 100644 test/libraries/rte/PMA_TRI_getEditorForm_test.php
create mode 100644 test/libraries/rte/PMA_TRI_getQueryFromRequest_test.php
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 41782b7..2d65b67 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -35,6 +35,7 @@
<file>test/Environment_test.php</file>
<directory suffix="_test.php">test/libraries/core</directory>
<directory suffix="_test.php">test/libraries/common</directory>
+ <directory suffix="_test.php">test/libraries/rte</directory>
<directory suffix="_test.php">test/libraries</directory>
</testsuite>
<!--<testsuite name="Selenium">-->
diff --git a/test/libraries/rte/PMA_EVN_getDataFromRequest_test.php b/test/libraries/rte/PMA_EVN_getDataFromRequest_test.php
new file mode 100644
index 0000000..382ade5
--- /dev/null
+++ b/test/libraries/rte/PMA_EVN_getDataFromRequest_test.php
@@ -0,0 +1,104 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for fetching event data from HTTP request
+ *
+ * @package phpMyAdmin-test
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/rte/rte_events.lib.php';
+
+class PMA_EVN_getDataFromRequest_test extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @dataProvider provider
+ */
+ public function testgetDataFromRequest_empty($in, $out)
+ {
+ global $_REQUEST;
+
+ unset($_REQUEST);
+ foreach ($in as $key => $value) {
+ if ($value !== '') {
+ $_REQUEST[$key] = $value;
+ }
+ }
+ $this->assertEquals($out, PMA_EVN_getDataFromRequest());
+ }
+
+ public function provider()
+ {
+ return array(
+ array(
+ array(
+ 'item_name' => '',
+ 'item_type' => '',
+ 'item_original_name' => '',
+ 'item_status' => '',
+ 'item_execute_at' => '',
+ 'item_interval_value' => '',
+ 'item_interval_field' => '',
+ 'item_starts' => '',
+ 'item_ends' => '',
+ 'item_definition' => '',
+ 'item_preserve' => '',
+ 'item_comment' => '',
+ 'item_definer' => ''
+ ),
+ array(
+ 'item_name' => '',
+ 'item_type' => 'ONE TIME',
+ 'item_type_toggle' => 'RECURRING',
+ 'item_original_name' => '',
+ 'item_status' => '',
+ 'item_execute_at' => '',
+ 'item_interval_value' => '',
+ 'item_interval_field' => '',
+ 'item_starts' => '',
+ 'item_ends' => '',
+ 'item_definition' => '',
+ 'item_preserve' => '',
+ 'item_comment' => '',
+ 'item_definer' => ''
+ )
+ ),
+ array(
+ array(
+ 'item_name' => 'foo',
+ 'item_type' => 'RECURRING',
+ 'item_original_name' => 'foo',
+ 'item_status' => 'foo',
+ 'item_execute_at' => 'foo',
+ 'item_interval_value' => 'foo',
+ 'item_interval_field' => 'foo',
+ 'item_starts' => 'foo',
+ 'item_ends' => 'foo',
+ 'item_definition' => 'foo',
+ 'item_preserve' => 'foo',
+ 'item_comment' => 'foo',
+ 'item_definer' => 'foo'
+ ),
+ array(
+ 'item_name' => 'foo',
+ 'item_type' => 'RECURRING',
+ 'item_type_toggle' => 'ONE TIME',
+ 'item_original_name' => 'foo',
+ 'item_status' => 'foo',
+ 'item_execute_at' => 'foo',
+ 'item_interval_value' => 'foo',
+ 'item_interval_field' => 'foo',
+ 'item_starts' => 'foo',
+ 'item_ends' => 'foo',
+ 'item_definition' => 'foo',
+ 'item_preserve' => 'foo',
+ 'item_comment' => 'foo',
+ 'item_definer' => 'foo'
+ )
+ ),
+ );
+ }
+}
+?>
diff --git a/test/libraries/rte/PMA_EVN_getEditorForm_test.php b/test/libraries/rte/PMA_EVN_getEditorForm_test.php
new file mode 100644
index 0000000..4480f9e
--- /dev/null
+++ b/test/libraries/rte/PMA_EVN_getEditorForm_test.php
@@ -0,0 +1,445 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for generating event editor
+ *
+ * @package phpMyAdmin-test
+ */
+require_once 'libraries/php-gettext/gettext.inc';
+require_once 'libraries/url_generating.lib.php';
+require_once 'libraries/common.lib.php';
+/*
+ * Include to test.
+ */
+require_once 'libraries/rte/rte_events.lib.php';
+
+class PMA_EVN_getEditorForm_test extends PHPUnit_Framework_TestCase
+{
+ public function setUp()
+ {
+ if (! function_exists('PMA_DBI_get_tables')) {
+ function PMA_DBI_get_tables($db)
+ {
+ return array('table1', 'table`2');
+ }
+ }
+ $GLOBALS['tear_down']['token'] = false;
+ $GLOBALS['tear_down']['server'] = false;
+ if (! isset($_SESSION[' PMA_token '])) {
+ $_SESSION[' PMA_token '] = '';
+ $GLOBALS['tear_down']['token'] = true;
+ }
+ if (! isset($GLOBALS['cfg']['ServerDefault'])) {
+ $GLOBALS['cfg']['ServerDefault'] = '';
+ $GLOBALS['tear_down']['server'] = true;
+ }
+ }
+
+ public function tearDown()
+ {
+ if ($GLOBALS['tear_down']['token']) {
+ unset($_SESSION[' PMA_token ']);
+ }
+ if ($GLOBALS['tear_down']['server']) {
+ unset($GLOBALS['cfg']['ServerDefault']);
+ }
+ unset($GLOBALS['tear_down']);
+ }
+
+ /**
+ * @dataProvider provider_add
+ */
+ public function testgetEditorForm_add($data, $matcher)
+ {
+ $GLOBALS['is_ajax_request'] = false;
+ PMA_EVN_setGlobals();
+ $this->assertTag($matcher, PMA_EVN_getEditorForm('add', 'change', $data), '', false);
+ }
+
+ public function provider_add()
+ {
+ $data = array(
+ 'item_name' => '',
+ 'item_type' => 'ONE TIME',
+ 'item_type_toggle' => 'RECURRING',
+ 'item_original_name' => '',
+ 'item_status' => '',
+ 'item_execute_at' => '',
+ 'item_interval_value' => '',
+ 'item_interval_field' => '',
+ 'item_starts' => '',
+ 'item_ends' => '',
+ 'item_definition' => '',
+ 'item_preserve' => '',
+ 'item_comment' => '',
+ 'item_definer' => ''
+ );
+
+ return array(
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'add_item'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_name'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_status'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_type'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_changetype'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_execute_at'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_interval_value'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_interval_field'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_starts'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_ends'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'textarea',
+ 'attributes' => array(
+ 'name' => 'item_definition'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_preserve'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_definer'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_comment'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'editor_process_add'
+ )
+ )
+ )
+ );
+ }
+
+ /**
+ * @dataProvider provider_edit
+ */
+ public function testgetEditorForm_edit($data, $matcher)
+ {
+ $GLOBALS['is_ajax_request'] = false;
+ PMA_EVN_setGlobals();
+ $this->assertTag($matcher, PMA_EVN_getEditorForm('edit', 'change', $data), '', false);
+ }
+
+ public function provider_edit()
+ {
+ $data = array(
+ 'item_name' => 'foo',
+ 'item_type' => 'RECURRING',
+ 'item_type_toggle' => 'ONE TIME',
+ 'item_original_name' => 'bar',
+ 'item_status' => 'ENABLED',
+ 'item_execute_at' => '',
+ 'item_interval_value' => '1',
+ 'item_interval_field' => 'DAY',
+ 'item_starts' => '',
+ 'item_ends' => '',
+ 'item_definition' => 'SET @A=1;',
+ 'item_preserve' => '',
+ 'item_comment' => '',
+ 'item_definer' => ''
+ );
+
+ return array(
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'edit_item'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_name'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_status'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_type'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_changetype'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_execute_at'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_interval_value'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_interval_field'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_starts'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_ends'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'textarea',
+ 'attributes' => array(
+ 'name' => 'item_definition'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_preserve'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_definer'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_comment'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'editor_process_edit'
+ )
+ )
+ )
+ );
+ }
+
+ /**
+ * @dataProvider provider_ajax
+ */
+ public function testgetEditorForm_ajax($data, $matcher)
+ {
+ $GLOBALS['is_ajax_request'] = true;
+ PMA_EVN_setGlobals();
+ $this->assertTag($matcher, PMA_EVN_getEditorForm('edit', 'change', $data), '', false);
+ }
+
+ public function provider_ajax()
+ {
+ $data = array(
+ 'item_name' => '',
+ 'item_type' => 'RECURRING',
+ 'item_type_toggle' => 'ONE TIME',
+ 'item_original_name' => '',
+ 'item_status' => 'ENABLED',
+ 'item_execute_at' => '',
+ 'item_interval_value' => '',
+ 'item_interval_field' => 'DAY',
+ 'item_starts' => '',
+ 'item_ends' => '',
+ 'item_definition' => '',
+ 'item_preserve' => '',
+ 'item_comment' => '',
+ 'item_definer' => ''
+ );
+
+ return array(
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_type'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'editor_process_edit'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'ajax_request'
+ )
+ )
+ )
+ );
+ }
+}
+?>
diff --git a/test/libraries/rte/PMA_EVN_getQueryFromRequest_test.php b/test/libraries/rte/PMA_EVN_getQueryFromRequest_test.php
new file mode 100644
index 0000000..5c6603d
--- /dev/null
+++ b/test/libraries/rte/PMA_EVN_getQueryFromRequest_test.php
@@ -0,0 +1,144 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for generating CREATE EVENT query from HTTP request
+ *
+ * @package phpMyAdmin-test
+ */
+
+/*
+ * Needed for PMA_backquote()
+ */
+require_once 'libraries/common.lib.php';
+
+/*
+ * Needed by PMA_EVN_getQueryFromRequest()
+ */
+require_once 'libraries/php-gettext/gettext.inc';
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/rte/rte_events.lib.php';
+
+
+class PMA_EVN_getQueryFromRequest_test extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @dataProvider provider
+ */
+ public function testgetQueryFromRequest($request, $query, $num_err)
+ {
+ global $_REQUEST, $errors;
+
+ $errors = array();
+ PMA_EVN_setGlobals();
+
+ unset($_REQUEST);
+ $_REQUEST = $request;
+
+ $this->assertEquals($query, PMA_EVN_getQueryFromRequest());
+ $this->assertEquals($num_err, count($errors));
+ }
+
+ public function provider()
+ {
+ return array(
+ // Testing success
+ array(
+ array( // simple once-off event
+ 'item_name' => 's o m e e v e n t\\',
+ 'item_type' => 'ONE TIME',
+ 'item_execute_at' => '2050-01-01 00:00:00',
+ 'item_definition' => 'SET @A=0;'
+ ),
+ 'CREATE EVENT `s o m e e v e n t\` ON SCHEDULE AT \'2050-01-01 00:00:00\' ON COMPLETION NOT PRESERVE DO SET @A=0;',
+ 0
+ ),
+ array(
+ array( // full once-off event
+ 'item_name' => 'evn',
+ 'item_definer' => 'me@home',
+ 'item_type' => 'ONE TIME',
+ 'item_execute_at' => '2050-01-01 00:00:00',
+ 'item_preserve' => 'ON',
+ 'item_status' => 'ENABLED',
+ 'item_definition' => 'SET @A=0;'
+ ),
+ 'CREATE DEFINER=`me`@`home` EVENT `evn` ON SCHEDULE AT \'2050-01-01 00:00:00\' ON COMPLETION PRESERVE ENABLE DO SET @A=0;',
+ 0
+ ),
+ array(
+ array( // simple recurring event
+ 'item_name' => 'rec_``evn',
+ 'item_type' => 'RECURRING',
+ 'item_interval_value' => '365',
+ 'item_interval_field' => 'DAY',
+ 'item_status' => 'DISABLED',
+ 'item_definition' => 'SET @A=0;'
+ ),
+ 'CREATE EVENT `rec_````evn` ON SCHEDULE EVERY 365 DAY ON COMPLETION NOT PRESERVE DISABLE DO SET @A=0;',
+ 0
+ ),
+ array(
+ array( // full recurring event
+ 'item_name' => 'rec_evn2',
+ 'item_definer' => 'evil``user><\\@work\\',
+ 'item_type' => 'RECURRING',
+ 'item_interval_value' => '365',
+ 'item_interval_field' => 'DAY',
+ 'item_starts' => '1900-01-01',
+ 'item_ends' => '2050-01-01',
+ 'item_preserve' => 'ON',
+ 'item_status' => 'SLAVESIDE_DISABLED',
+ 'item_definition' => 'SET @A=0;'
+ ),
+ 'CREATE DEFINER=`evil````user><\`@`work\` EVENT `rec_evn2` ON SCHEDULE EVERY 365 DAY STARTS \'1900-01-01\' ENDS \'2050-01-01\' ON COMPLETION PRESERVE DISABLE ON SLAVE DO SET @A=0;',
+ 0
+ ),
+ // Testing failures
+ array(
+ array( // empty request
+ ),
+ 'CREATE EVENT ON SCHEDULE ON COMPLETION NOT PRESERVE DO ',
+ 3
+ ),
+ array(
+ array(
+ 'item_name' => 's o m e e v e n t\\',
+ 'item_definer' => 'someuser', // invalid definer format
+ 'item_type' => 'ONE TIME',
+ 'item_execute_at' => '', // no execution time
+ 'item_definition' => 'SET @A=0;'
+ ),
+ 'CREATE EVENT `s o m e e v e n t\` ON SCHEDULE ON COMPLETION NOT PRESERVE DO SET @A=0;',
+ 2
+ ),
+ array(
+ array(
+ 'item_name' => 'rec_``evn',
+ 'item_type' => 'RECURRING',
+ 'item_interval_value' => '', // no interval value
+ 'item_interval_field' => 'DAY',
+ 'item_status' => 'DISABLED',
+ 'item_definition' => 'SET @A=0;'
+ ),
+ 'CREATE EVENT `rec_````evn` ON SCHEDULE ON COMPLETION NOT PRESERVE DISABLE DO SET @A=0;',
+ 1
+ ),
+ array(
+ array( // simple recurring event
+ 'item_name' => 'rec_``evn',
+ 'item_type' => 'RECURRING',
+ 'item_interval_value' => '365',
+ 'item_interval_field' => 'CENTURIES', // invalid interval field
+ 'item_status' => 'DISABLED',
+ 'item_definition' => 'SET @A=0;'
+ ),
+ 'CREATE EVENT `rec_````evn` ON SCHEDULE ON COMPLETION NOT PRESERVE DISABLE DO SET @A=0;',
+ 1
+ ),
+ );
+ }
+}
+?>
diff --git a/test/libraries/rte/PMA_RTN_ParameterParser_test.php b/test/libraries/rte/PMA_RTN_ParameterParser_test.php
new file mode 100644
index 0000000..fa80f8b
--- /dev/null
+++ b/test/libraries/rte/PMA_RTN_ParameterParser_test.php
@@ -0,0 +1,163 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for parsing of Routine parameters
+ *
+ * @package phpMyAdmin-test
+ */
+
+/*
+ * Needed for PMA_unQuote() and PMA_SQP_parse()
+ */
+require_once 'libraries/common.lib.php';
+require_once 'libraries/sqlparser.lib.php';
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/rte/rte_routines.lib.php';
+
+
+class PMA_RTN_parameterParser_test extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @dataProvider definer_provider
+ */
+ public function test_parseDefiner($source, $target)
+ {
+ PMA_RTN_setGlobals();
+ $this->assertEquals($target, PMA_RTN_parseRoutineDefiner(PMA_SQP_parse($source)));
+ }
+
+ public function definer_provider()
+ {
+ return array(
+ array('CREATE PROCEDURE FOO() SELECT NULL', ''),
+ array('CREATE DEFINER=`root`@`localhost` PROCEDURE FOO() SELECT NULL', 'root@localhost'),
+ array('CREATE DEFINER=`root\\`@`localhost` PROCEDURE FOO() SELECT NULL', 'root\\@localhost'),
+ );
+ }
+
+ /**
+ * @dataProvider param_provider
+ */
+ public function test_parseOneParameter($source, $target)
+ {
+ PMA_RTN_setGlobals();
+ $this->assertEquals($target, PMA_RTN_parseOneParameter($source));
+ }
+
+ public function param_provider()
+ {
+ return array(
+ array('`foo` TEXT', array('', 'foo', 'TEXT', '', '')),
+ array('`foo` INT(20)', array('', 'foo', 'INT', '20', '')),
+ array('DECIMAL(5,5)', array('', '', 'DECIMAL', '5,5', '')),
+ array('IN `fo``fo` INT UNSIGNED', array('IN', 'fo`fo', 'INT', '', 'UNSIGNED')),
+ array('OUT bar VARCHAR(1) CHARSET utf8', array('OUT', 'bar', 'VARCHAR', '1', 'utf8')),
+ array('`"baz\'\'` ENUM(\'a\', \'b\') CHARSET latin1', array('', '"baz\'\'', 'ENUM', '\'a\',\'b\'', 'latin1')),
+ array('INOUT `foo` DECIMAL(5,2) UNSIGNED ZEROFILL', array('INOUT', 'foo', 'DECIMAL', '5,2', 'UNSIGNED ZEROFILL')),
+ array('`foo``s func` SET(\'test\'\'esc"\', \'more\\\'esc\')', array('', 'foo`s func', 'SET', '\'test\'\'esc"\',\'more\\\'esc\'', ''))
+ );
+ }
+
+ /**
+ * @depends test_parseOneParameter
+ * @dataProvider query_provider
+ */
+ public function test_parseAllParameters($query, $type, $target)
+ {
+ PMA_RTN_setGlobals();
+ $this->assertEquals($target, PMA_RTN_parseAllParameters(PMA_SQP_parse($query), $type));
+ }
+
+ public function query_provider()
+ {
+ return array(
+ array(
+ 'CREATE PROCEDURE `foo`() SET @A=0',
+ 'PROCEDURE',
+ array(
+ 'num' => 0,
+ 'dir' => array(),
+ 'name' => array(),
+ 'type' => array(),
+ 'length' => array(),
+ 'opts' => array()
+ )
+ ),
+ array(
+ 'CREATE DEFINER=`user\\`@`somehost``(` FUNCTION `foo```(`baz` INT) BEGIN SELECT NULL; END',
+ 'FUNCTION',
+ array(
+ 'num' => 1,
+ 'dir' => array(
+ 0 => ''
+ ),
+ 'name' => array(
+ 0 => 'baz'
+ ),
+ 'type' => array(
+ 0 => 'INT'
+ ),
+ 'length' => array(
+ 0 => ''
+ ),
+ 'opts' => array(
+ 0 => ''
+ )
+ )
+ ),
+ array(
+ 'CREATE PROCEDURE `foo`(IN `baz\\)` INT(25) zerofill unsigned) BEGIN SELECT NULL; END',
+ 'PROCEDURE',
+ array(
+ 'num' => 1,
+ 'dir' => array(
+ 0 => 'IN'
+ ),
+ 'name' => array(
+ 0 => 'baz\\)'
+ ),
+ 'type' => array(
+ 0 => 'INT'
+ ),
+ 'length' => array(
+ 0 => '25'
+ ),
+ 'opts' => array(
+ 0 => 'UNSIGNED ZEROFILL'
+ )
+ )
+ ),
+ array(
+ 'CREATE PROCEDURE `foo`(IN `baz\\` INT(001) zerofill, out bazz varchar(15) charset UTF8) BEGIN SELECT NULL; END',
+ 'PROCEDURE',
+ array(
+ 'num' => 2,
+ 'dir' => array(
+ 0 => 'IN',
+ 1 => 'OUT'
+ ),
+ 'name' => array(
+ 0 => 'baz\\',
+ 1 => 'bazz'
+ ),
+ 'type' => array(
+ 0 => 'INT',
+ 1 => 'VARCHAR'
+ ),
+ 'length' => array(
+ 0 => '1',
+ 1 => '15'
+ ),
+ 'opts' => array(
+ 0 => 'ZEROFILL',
+ 1 => 'utf8'
+ )
+ )
+ ),
+ );
+ }
+}
+?>
diff --git a/test/libraries/rte/PMA_RTN_getDataFromRequest_test.php b/test/libraries/rte/PMA_RTN_getDataFromRequest_test.php
new file mode 100644
index 0000000..d24de2b
--- /dev/null
+++ b/test/libraries/rte/PMA_RTN_getDataFromRequest_test.php
@@ -0,0 +1,197 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for fetching routine data from HTTP request
+ *
+ * @package phpMyAdmin-test
+ */
+
+require_once 'libraries/data_mysql.inc.php';
+require_once 'libraries/common.lib.php';
+
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/rte/rte_routines.lib.php';
+
+class PMA_RTN_getDataFromRequest_test extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @dataProvider provider
+ */
+ public function testgetDataFromRequest($in, $out)
+ {
+ global $cfg, $_REQUEST;
+
+ if (! isset($cfg['ColumnTypes'])) {
+ $this->markTestSkipped('Can\'t get column types'); // FIXME
+ }
+
+ unset($_REQUEST);
+ foreach ($in as $key => $value) {
+ if ($value !== '') {
+ $_REQUEST[$key] = $value;
+ }
+ }
+ PMA_RTN_setGlobals();
+ $this->assertEquals($out, PMA_RTN_getDataFromRequest());
+ }
+
+ public function provider()
+ {
+ return array(
+ array(
+ array(
+ 'item_name' => '',
+ 'item_original_name' => '',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => '',
+ 'item_comment' => '',
+ 'item_definer' => '',
+ 'item_type' => '',
+ 'item_type_toggle' => '',
+ 'item_original_type' => '',
+ 'item_param_dir' => '',
+ 'item_param_name' => '',
+ 'item_param_type' => '',
+ 'item_param_length' => '',
+ 'item_param_opts_num' => '',
+ 'item_param_opts_text' => '',
+ 'item_returntype' => '',
+ 'item_isdeterministic' => '',
+ 'item_securitytype' => '',
+ 'item_sqldataaccess' => ''
+ ),
+ array(
+ 'item_name' => '',
+ 'item_original_name' => '',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => '',
+ 'item_comment' => '',
+ 'item_definer' => '',
+ 'item_type' => 'PROCEDURE',
+ 'item_type_toggle' => 'FUNCTION',
+ 'item_original_type' => 'PROCEDURE',
+ 'item_num_params' => 0,
+ 'item_param_dir' => array(),
+ 'item_param_name' => array(),
+ 'item_param_type' => array(),
+ 'item_param_length' => array(),
+ 'item_param_opts_num' => array(),
+ 'item_param_opts_text' => array(),
+ 'item_returntype' => '',
+ 'item_isdeterministic' => '',
+ 'item_securitytype_definer' => '',
+ 'item_securitytype_invoker' => '',
+ 'item_sqldataaccess' => ''
+ )
+ ),
+ array(
+ array(
+ 'item_name' => 'proc2',
+ 'item_original_name' => 'proc',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => 'SELECT NULL',
+ 'item_comment' => 'some text',
+ 'item_definer' => 'root@localhost',
+ 'item_type' => 'PROCEDURE',
+ 'item_type_toggle' => 'FUNCTION',
+ 'item_original_type' => 'PROCEDURE',
+ 'item_param_dir' => array(0 => 'IN', 1 => 'FAIL'),
+ 'item_param_name' => array(0 => 'bar', 1 => 'baz'),
+ 'item_param_type' => array(0 => 'INT', 1 => 'FAIL'),
+ 'item_param_length' => array(0 => '20', 1 => ''),
+ 'item_param_opts_num' => array(0 => 'UNSIGNED', 1 => ''),
+ 'item_param_opts_text' => array(0 => '', 1 => 'latin1'),
+ 'item_returntype' => '',
+ 'item_isdeterministic' => 'ON',
+ 'item_securitytype' => 'INVOKER',
+ 'item_sqldataaccess' => 'NO SQL'
+ ),
+ array(
+ 'item_name' => 'proc2',
+ 'item_original_name' => 'proc',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => 'SELECT NULL',
+ 'item_comment' => 'some text',
+ 'item_definer' => 'root@localhost',
+ 'item_type' => 'PROCEDURE',
+ 'item_type_toggle' => 'FUNCTION',
+ 'item_original_type' => 'PROCEDURE',
+ 'item_num_params' => 2,
+ 'item_param_dir' => array(0 => 'IN', 1 => ''),
+ 'item_param_name' => array(0 => 'bar', 1 => 'baz'),
+ 'item_param_type' => array(0 => 'INT', 1 => ''),
+ 'item_param_length' => array(0 => '20', 1 => ''),
+ 'item_param_opts_num' => array(0 => 'UNSIGNED', 1 => ''),
+ 'item_param_opts_text' => array(0 => '', 1 => 'latin1'),
+ 'item_returntype' => '',
+ 'item_isdeterministic' => ' checked=\'checked\'',
+ 'item_securitytype_definer' => '',
+ 'item_securitytype_invoker' => ' selected=\'selected\'',
+ 'item_sqldataaccess' => 'NO SQL'
+ )
+ ),
+ array(
+ array(
+ 'item_name' => 'func2',
+ 'item_original_name' => 'func',
+ 'item_returnlength' => '20',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => 'CHARSET utf8',
+ 'item_definition' => 'SELECT NULL',
+ 'item_comment' => 'some text',
+ 'item_definer' => 'root@localhost',
+ 'item_type' => 'FUNCTION',
+ 'item_type_toggle' => 'PROCEDURE',
+ 'item_original_type' => 'FUNCTION',
+ 'item_param_dir' => array(0 => '', 1 => ''),
+ 'item_param_name' => array(0 => 'bar', 1 => 'baz'),
+ 'item_param_type' => array(0 => '<s>XSS</s>', 1 => 'TEXT'),
+ 'item_param_length' => array(0 => '10,10', 1 => ''),
+ 'item_param_opts_num' => array(0 => 'UNSIGNED', 1 => ''),
+ 'item_param_opts_text' => array(0 => '', 1 => 'utf8'),
+ 'item_returntype' => 'VARCHAR',
+ 'item_isdeterministic' => '',
+ 'item_securitytype' => 'DEFINER',
+ 'item_sqldataaccess' => ''
+ ),
+ array(
+ 'item_name' => 'func2',
+ 'item_original_name' => 'func',
+ 'item_returnlength' => '20',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => 'CHARSET utf8',
+ 'item_definition' => 'SELECT NULL',
+ 'item_comment' => 'some text',
+ 'item_definer' => 'root@localhost',
+ 'item_type' => 'FUNCTION',
+ 'item_type_toggle' => 'PROCEDURE',
+ 'item_original_type' => 'FUNCTION',
+ 'item_num_params' => '2',
+ 'item_param_dir' => array(),
+ 'item_param_name' => array(0 => 'bar', 1 => 'baz'),
+ 'item_param_type' => array(0 => '', 1 => 'TEXT'),
+ 'item_param_length' => array(0 => '10,10', 1 => ''),
+ 'item_param_opts_num' => array(0 => 'UNSIGNED', 1 => ''),
+ 'item_param_opts_text' => array(0 => '', 1 => 'utf8'),
+ 'item_returntype' => 'VARCHAR',
+ 'item_isdeterministic' => '',
+ 'item_securitytype_definer' => ' selected=\'selected\'',
+ 'item_securitytype_invoker' => '',
+ 'item_sqldataaccess' => ''
+ )
+ ),
+ );
+ }
+}
+?>
diff --git a/test/libraries/rte/PMA_RTN_getEditorForm_test.php b/test/libraries/rte/PMA_RTN_getEditorForm_test.php
new file mode 100644
index 0000000..ef96a79
--- /dev/null
+++ b/test/libraries/rte/PMA_RTN_getEditorForm_test.php
@@ -0,0 +1,885 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for generating routine editor
+ *
+ * @package phpMyAdmin-test
+ */
+require_once 'libraries/common.lib.php';
+require_once 'libraries/data_mysql.inc.php';
+require_once 'libraries/php-gettext/gettext.inc';
+require_once 'libraries/url_generating.lib.php';
+/*
+ * Include to test.
+ */
+require_once 'libraries/rte/rte_routines.lib.php';
+
+class PMA_RTN_getEditorForm_test extends PHPUnit_Framework_TestCase
+{
+ public function setUp()
+ {
+ if (! function_exists('PMA_generateCharsetDropdownBox')) {
+ function PMA_generateCharsetDropdownBox() {}
+ }
+ if (! defined('PMA_CSDROPDOWN_CHARSET')) {
+ define('PMA_CSDROPDOWN_CHARSET', '');
+ }
+ if (! function_exists('PMA_DBI_get_tables')) {
+ function PMA_DBI_get_tables($db)
+ {
+ return array('table1', 'table`2');
+ }
+ }
+ $GLOBALS['tear_down']['token'] = false;
+ $GLOBALS['tear_down']['server'] = false;
+ if (! isset($_SESSION[' PMA_token '])) {
+ $_SESSION[' PMA_token '] = '';
+ $GLOBALS['tear_down']['token'] = true;
+ }
+ if (! isset($GLOBALS['cfg']['ServerDefault'])) {
+ $GLOBALS['cfg']['ServerDefault'] = '';
+ $GLOBALS['tear_down']['server'] = true;
+ }
+ }
+
+ public function tearDown()
+ {
+ if ($GLOBALS['tear_down']['token']) {
+ unset($_SESSION[' PMA_token ']);
+ }
+ if ($GLOBALS['tear_down']['server']) {
+ unset($GLOBALS['cfg']['ServerDefault']);
+ }
+ unset($GLOBALS['tear_down']);
+ }
+
+ public function testgetParameterRow_empty()
+ {
+ $GLOBALS['is_ajax_request'] = false;
+ PMA_RTN_setGlobals();
+ $this->assertEquals('', PMA_RTN_getParameterRow(array(), 0));
+ }
+
+ /**
+ * @depends testgetParameterRow_empty
+ * @dataProvider provider_row
+ */
+ public function testgetParameterRow($data, $index, $matcher)
+ {
+ $GLOBALS['is_ajax_request'] = false;
+ PMA_RTN_setGlobals();
+ $this->assertTag($matcher, PMA_RTN_getParameterRow($data, $index), false);
+ }
+
+ public function provider_row()
+ {
+ $data = array(
+ 'item_name' => '',
+ 'item_original_name' => '',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => '',
+ 'item_comment' => '',
+ 'item_definer' => '',
+ 'item_type' => 'PROCEDURE',
+ 'item_type_toggle' => 'FUNCTION',
+ 'item_original_type' => 'PROCEDURE',
+ 'item_num_params' => 1,
+ 'item_param_dir' => array(0 => 'IN'),
+ 'item_param_name' => array(0 => 'foo'),
+ 'item_param_type' => array(0 => 'INT'),
+ 'item_param_length' => array(0 => ''),
+ 'item_param_opts_num' => array(0 => 'UNSIGNED'),
+ 'item_param_opts_text' => array(0 => ''),
+ 'item_returntype' => '',
+ 'item_isdeterministic' => '',
+ 'item_securitytype_definer' => '',
+ 'item_securitytype_invoker' => '',
+ 'item_sqldataaccess' => ''
+ );
+
+ return array(
+ array(
+ $data,
+ 0,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_param_dir[0]'
+ )
+ )
+ ),
+ array(
+ $data,
+ 0,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_param_name[0]'
+ )
+ )
+ ),
+ array(
+ $data,
+ 0,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_param_type[0]'
+ )
+ )
+ ),
+ array(
+ $data,
+ 0,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_param_length[0]'
+ )
+ )
+ ),
+ array(
+ $data,
+ 0,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_param_opts_num[0]'
+ )
+ )
+ ),
+ array(
+ $data,
+ 0,
+ array(
+ 'tag' => 'a',
+ 'attributes' => array(
+ 'class' => 'routine_param_remove_anchor'
+ )
+ )
+ ),
+ );
+ }
+
+ /**
+ * @depends testgetParameterRow
+ * @dataProvider provider_row_ajax
+ */
+ public function testgetParameterRow_ajax($data, $matcher)
+ {
+ $GLOBALS['is_ajax_request'] = false;
+ PMA_RTN_setGlobals();
+ $this->assertTag($matcher, PMA_RTN_getParameterRow($data), false);
+ }
+
+ public function provider_row_ajax()
+ {
+ $data = array(
+ 'item_name' => '',
+ 'item_original_name' => '',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => '',
+ 'item_comment' => '',
+ 'item_definer' => '',
+ 'item_type' => 'PROCEDURE',
+ 'item_type_toggle' => 'FUNCTION',
+ 'item_original_type' => 'PROCEDURE',
+ 'item_num_params' => 1,
+ 'item_param_dir' => array(0 => 'IN'),
+ 'item_param_name' => array(0 => 'foo'),
+ 'item_param_type' => array(0 => 'INT'),
+ 'item_param_length' => array(0 => ''),
+ 'item_param_opts_num' => array(0 => 'UNSIGNED'),
+ 'item_param_opts_text' => array(0 => ''),
+ 'item_returntype' => '',
+ 'item_isdeterministic' => '',
+ 'item_securitytype_definer' => '',
+ 'item_securitytype_invoker' => '',
+ 'item_sqldataaccess' => ''
+ );
+
+ return array(
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_param_dir[%s]'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_param_name[%s]'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_param_type[%s]'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_param_length[%s]'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_param_opts_num[%s]'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'a',
+ 'attributes' => array(
+ 'class' => 'routine_param_remove_anchor'
+ )
+ )
+ ),
+ );
+ }
+
+ /**
+ * @depends testgetParameterRow_ajax
+ * @dataProvider provider_editor_1
+ */
+ public function testgetEditorForm_1($data, $matcher)
+ {
+ $GLOBALS['is_ajax_request'] = false;
+ PMA_RTN_setGlobals();
+ $this->assertTag($matcher, PMA_RTN_getEditorForm('add', '', $data), false);
+ }
+
+ public function provider_editor_1()
+ {
+ $data = array(
+ 'item_name' => '',
+ 'item_original_name' => '',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => '',
+ 'item_comment' => '',
+ 'item_definer' => '',
+ 'item_type' => 'PROCEDURE',
+ 'item_type_toggle' => 'FUNCTION',
+ 'item_original_type' => 'PROCEDURE',
+ 'item_num_params' => 0,
+ 'item_param_dir' => array(),
+ 'item_param_name' => array(),
+ 'item_param_type' => array(),
+ 'item_param_length' => array(),
+ 'item_param_opts_num' => array(),
+ 'item_param_opts_text' => array(),
+ 'item_returntype' => '',
+ 'item_isdeterministic' => '',
+ 'item_securitytype_definer' => '',
+ 'item_securitytype_invoker' => '',
+ 'item_sqldataaccess' => ''
+ );
+
+ return array(
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'add_item'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_name'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_type'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'routine_changetype'
+ )
+ )
+ ),
+
+
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'routine_addparameter'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'routine_removeparameter'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_returntype'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_returnlength'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_returnopts_num'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'textarea',
+ 'attributes' => array(
+ 'name' => 'item_definition'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_isdeterministic'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_definer'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_securitytype'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_sqldataaccess'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_comment'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'editor_process_add'
+ )
+ )
+ ),
+
+ );
+ }
+
+ /**
+ * @depends testgetParameterRow_ajax
+ * @dataProvider provider_editor_2
+ */
+ public function testgetEditorForm_2($data, $matcher)
+ {
+ $GLOBALS['is_ajax_request'] = false;
+ PMA_RTN_setGlobals();
+ $this->assertTag($matcher, PMA_RTN_getEditorForm('edit', 'change', $data), false);
+ }
+
+ public function provider_editor_2()
+ {
+ $data = array(
+ 'item_name' => 'foo',
+ 'item_original_name' => 'bar',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => 'SELECT 1',
+ 'item_comment' => '',
+ 'item_definer' => '',
+ 'item_type' => 'PROCEDURE',
+ 'item_type_toggle' => 'FUNCTION',
+ 'item_original_type' => 'PROCEDURE',
+ 'item_num_params' => 1,
+ 'item_param_dir' => array(0 => 'IN'),
+ 'item_param_name' => array(0 => 'baz'),
+ 'item_param_type' => array(0 => 'INT'),
+ 'item_param_length' => array(0 => '20'),
+ 'item_param_opts_num' => array(0 => 'UNSIGNED'),
+ 'item_param_opts_text' => array(0 => ''),
+ 'item_returntype' => '',
+ 'item_isdeterministic' => '',
+ 'item_securitytype_definer' => '',
+ 'item_securitytype_invoker' => '',
+ 'item_sqldataaccess' => 'NO SQL'
+ );
+
+ return array(
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'edit_item'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_name'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_type',
+ 'value' => 'FUNCTION'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'routine_changetype'
+ )
+ )
+ ),
+
+
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'routine_addparameter'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'routine_removeparameter'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_returntype'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_returnlength'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_returnopts_num'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'textarea',
+ 'attributes' => array(
+ 'name' => 'item_definition'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_isdeterministic'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_definer'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_securitytype'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_sqldataaccess'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_comment'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'editor_process_edit'
+ )
+ )
+ ),
+
+ );
+ }
+
+ /**
+ * @depends testgetParameterRow_ajax
+ * @dataProvider provider_editor_3
+ */
+ public function testgetEditorForm_3($data, $matcher)
+ {
+ $GLOBALS['is_ajax_request'] = true;
+ PMA_RTN_setGlobals();
+ $this->assertTag($matcher, PMA_RTN_getEditorForm('edit', 'remove', $data), false);
+ }
+
+ public function provider_editor_3()
+ {
+ $data = array(
+ 'item_name' => 'foo',
+ 'item_original_name' => 'bar',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => 'UNSIGNED',
+ 'item_returnopts_text' => '',
+ 'item_definition' => 'SELECT 1',
+ 'item_comment' => '',
+ 'item_definer' => '',
+ 'item_type' => 'FUNCTION',
+ 'item_type_toggle' => 'PROCEDURE',
+ 'item_original_type' => 'FUNCTION',
+ 'item_num_params' => 1,
+ 'item_param_dir' => array(0 => ''),
+ 'item_param_name' => array(0 => 'baz'),
+ 'item_param_type' => array(0 => 'INT'),
+ 'item_param_length' => array(0 => '20'),
+ 'item_param_opts_num' => array(0 => 'UNSIGNED'),
+ 'item_param_opts_text' => array(0 => ''),
+ 'item_returntype' => 'INT',
+ 'item_isdeterministic' => '',
+ 'item_securitytype_definer' => '',
+ 'item_securitytype_invoker' => '',
+ 'item_sqldataaccess' => 'NO SQL'
+ );
+
+ return array(
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'edit_item'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_name'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_type'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'routine_addparameter'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'routine_removeparameter'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_returntype'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_returnlength'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_returnopts_num'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'textarea',
+ 'attributes' => array(
+ 'name' => 'item_definition'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_isdeterministic'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_definer'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_securitytype'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_sqldataaccess'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_comment'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'ajax_request'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'editor_process_edit'
+ )
+ )
+ ),
+
+ );
+ }
+
+ /**
+ * @depends testgetParameterRow_ajax
+ * @dataProvider provider_editor_4
+ */
+ public function testgetEditorForm_4($data, $matcher)
+ {
+ $GLOBALS['is_ajax_request'] = false;
+ PMA_RTN_setGlobals();
+ $this->assertTag($matcher, PMA_RTN_getEditorForm('edit', 'change', $data), false);
+ }
+
+ public function provider_editor_4()
+ {
+ $data = array(
+ 'item_name' => 'foo',
+ 'item_original_name' => 'bar',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => 'SELECT 1',
+ 'item_comment' => '',
+ 'item_definer' => '',
+ 'item_type' => 'FUNCTION',
+ 'item_type_toggle' => 'PROCEDURE',
+ 'item_original_type' => 'PROCEDURE',
+ 'item_num_params' => 1,
+ 'item_param_dir' => array(0 => 'IN'),
+ 'item_param_name' => array(0 => 'baz'),
+ 'item_param_type' => array(0 => 'INT'),
+ 'item_param_length' => array(0 => '20'),
+ 'item_param_opts_num' => array(0 => 'UNSIGNED'),
+ 'item_param_opts_text' => array(0 => ''),
+ 'item_returntype' => '',
+ 'item_isdeterministic' => '',
+ 'item_securitytype_definer' => '',
+ 'item_securitytype_invoker' => '',
+ 'item_sqldataaccess' => 'NO SQL'
+ );
+
+ return array(
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_type',
+ 'value' => 'PROCEDURE'
+ )
+ )
+ ),
+ );
+ }
+}
+?>
diff --git a/test/libraries/rte/PMA_RTN_getExecuteForm_test.php b/test/libraries/rte/PMA_RTN_getExecuteForm_test.php
new file mode 100644
index 0000000..eab74b4
--- /dev/null
+++ b/test/libraries/rte/PMA_RTN_getExecuteForm_test.php
@@ -0,0 +1,244 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for generating routine execution dialog
+ *
+ * @package phpMyAdmin-test
+ */
+require_once 'libraries/common.lib.php';
+require_once 'libraries/sqlparser.lib.php';
+require_once 'libraries/php-gettext/gettext.inc';
+require_once 'libraries/url_generating.lib.php';
+/*
+ * Include to test.
+ */
+require_once 'libraries/rte/rte_routines.lib.php';
+
+class PMA_RTN_getExecuteForm_test extends PHPUnit_Framework_TestCase
+{
+ public function setUp()
+ {
+ global $cfg;
+
+ if (! defined('PMA_MYSQL_INT_VERSION')) {
+ define('PMA_MYSQL_INT_VERSION', 51000);
+ }
+
+ if (! function_exists('PMA_generateCharsetDropdownBox')) {
+ function PMA_generateCharsetDropdownBox() {}
+ }
+ if (! defined('PMA_CSDROPDOWN_CHARSET')) {
+ define('PMA_CSDROPDOWN_CHARSET', '');
+ }
+ if (! function_exists('PMA_DBI_get_tables')) {
+ function PMA_DBI_get_tables($db)
+ {
+ return array('table1', 'table`2');
+ }
+ }
+ $GLOBALS['tear_down']['token'] = false;
+ $GLOBALS['tear_down']['server'] = false;
+ $GLOBALS['tear_down']['default'] = false;
+ if (! isset($_SESSION[' PMA_token '])) {
+ $_SESSION[' PMA_token '] = '';
+ $GLOBALS['tear_down']['token'] = true;
+ }
+ if (! isset($GLOBALS['cfg']['ServerDefault'])) {
+ $GLOBALS['cfg']['ServerDefault'] = '';
+ $GLOBALS['tear_down']['server'] = true;
+ }
+ $cfg['ShowFunctionFields'] = true;
+ if (! isset($GLOBALS['cfg']['DefaultFunctions'])) {
+ $cfg['DefaultFunctions']['FUNC_NUMBER'] = '';
+ $cfg['DefaultFunctions']['FUNC_DATE'] = '';
+ $GLOBALS['tear_down']['default'] = true;
+ }
+ eval(substr(file_get_contents('libraries/data_mysql.inc.php'), 5, -3)); // FIXME
+ }
+
+ public function tearDown()
+ {
+ if ($GLOBALS['tear_down']['token']) {
+ unset($_SESSION[' PMA_token ']);
+ }
+ if ($GLOBALS['tear_down']['server']) {
+ unset($GLOBALS['cfg']['ServerDefault']);
+ }
+ if ($GLOBALS['tear_down']['default']) {
+ unset($GLOBALS['cfg']['DefaultFunctions']);
+ }
+ unset($GLOBALS['tear_down']);
+ }
+
+
+ /**
+ * @dataProvider provider_1
+ */
+ public function testgetExecuteForm_1($data, $matcher)
+ {
+ $GLOBALS['is_ajax_request'] = false;
+ PMA_RTN_setGlobals();
+ $this->assertTag($matcher, PMA_RTN_getExecuteForm($data), false);
+ }
+
+ public function provider_1()
+ {
+ $data = array(
+ 'item_name' => 'foo',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => 'SELECT 1;',
+ 'item_comment' => '',
+ 'item_definer' => '',
+ 'item_type' => 'PROCEDURE',
+ 'item_num_params' => 6,
+ 'item_param_dir' => array(0 => 'IN', 1 => 'OUT', 2 => 'IN', 3 => 'IN', 4 => 'IN', 5 => 'IN'),
+ 'item_param_name' => array(0 => 'foo', 1 => 'foa', 2 => 'fob', 3 => 'foc', 4 => 'fod', 5 => 'foe'),
+ 'item_param_type' => array(0 => 'DATE', 1 => 'VARCHAR', 2 => 'DATETIME', 3 => 'GEOMETRY', 4 => 'ENUM', 5 => 'SET'),
+ 'item_param_length' => array(0 => '', 1 => '22', 2 => '', 3 => '', 4 => "'a','b'", 5 => "'a','b'"),
+ 'item_param_opts_num' => array(0 => '', 1 => '', 2 => '', 3 => '', 4 => '', 5 => ''),
+ 'item_param_opts_text' => array(0 => '', 1 => 'utf8', 2 => '', 3 => '', 4 => '', 5 => ''),
+ 'item_returntype' => '',
+ 'item_isdeterministic' => '',
+ 'item_securitytype_definer' => '',
+ 'item_securitytype_invoker' => '',
+ 'item_sqldataaccess' => ''
+ );
+
+ return array(
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_name'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'funcs[foo]'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'params[foo]',
+ 'class' => 'datefield'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'funcs[fob]'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'params[fob]',
+ 'class' => 'datetimefield'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'params[fod][]'
+ ),
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'params[foe][]'
+ ),
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'execute_routine'
+ )
+ )
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider provider_2
+ */
+ public function testgetExecuteForm_2($data, $matcher)
+ {
+ $GLOBALS['is_ajax_request'] = true;
+ PMA_RTN_setGlobals();
+ $this->assertTag($matcher, PMA_RTN_getExecuteForm($data), false);
+ }
+
+ public function provider_2()
+ {
+ $data = array(
+ 'item_name' => 'foo',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => 'SELECT 1;',
+ 'item_comment' => '',
+ 'item_definer' => '',
+ 'item_type' => 'PROCEDURE',
+ 'item_num_params' => 6,
+ 'item_param_dir' => array(0 => 'IN', 1 => 'OUT', 2 => 'IN', 3 => 'IN', 4 => 'IN', 5 => 'IN'),
+ 'item_param_name' => array(0 => 'foo', 1 => 'foa', 2 => 'fob', 3 => 'foc', 4 => 'fod', 5 => 'foe'),
+ 'item_param_type' => array(0 => 'DATE', 1 => 'VARCHAR', 2 => 'DATETIME', 3 => 'GEOMETRY', 4 => 'ENUM', 5 => 'SET'),
+ 'item_param_length' => array(0 => '', 1 => '22', 2 => '', 3 => '', 4 => "'a','b'", 5 => "'a','b'"),
+ 'item_param_opts_num' => array(0 => '', 1 => '', 2 => '', 3 => '', 4 => '', 5 => ''),
+ 'item_param_opts_text' => array(0 => '', 1 => 'utf8', 2 => '', 3 => '', 4 => '', 5 => ''),
+ 'item_returntype' => '',
+ 'item_isdeterministic' => '',
+ 'item_securitytype_definer' => '',
+ 'item_securitytype_invoker' => '',
+ 'item_sqldataaccess' => ''
+ );
+
+ return array(
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'execute_routine'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'ajax_request'
+ )
+ )
+ ),
+ );
+ }
+}
+?>
diff --git a/test/libraries/rte/PMA_RTN_getQueryFromRequest_test.php b/test/libraries/rte/PMA_RTN_getQueryFromRequest_test.php
new file mode 100644
index 0000000..175c95b
--- /dev/null
+++ b/test/libraries/rte/PMA_RTN_getQueryFromRequest_test.php
@@ -0,0 +1,247 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for generating CREATE [PROCEDURE|FUNCTION] query from HTTP request
+ *
+ * @package phpMyAdmin-test
+ */
+
+/*
+ * Needed for PMA_backquote() and PMA_RTN_getQueryFromRequest()
+ */
+//require_once 'libraries/data_mysql.inc.php';
+require_once 'libraries/common.lib.php';
+require_once 'libraries/php-gettext/gettext.inc';
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/rte/rte_routines.lib.php';
+
+
+class PMA_RTN_getQueryFromRequest_test extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @dataProvider provider
+ */
+ public function testgetQueryFromRequest($request, $query, $num_err)
+ {
+ global $_REQUEST, $errors, $cfg;
+
+ // FIXME: the below two lines are needed to get the test to work,
+ // but are definitely the wrong way to go about the issue
+ // of $cfg['ColumnTypes'] being undefined
+ $cfg['ShowFunctionFields'] = false;
+ eval(substr(file_get_contents('libraries/data_mysql.inc.php'), 5, -3));
+
+ if (! isset($cfg['ColumnTypes'])) {
+ $this->markTestSkipped('Can\'t get column types'); // FIXME
+ }
+
+ $errors = array();
+ PMA_RTN_setGlobals();
+
+ unset($_REQUEST);
+ $_REQUEST = $request;
+ $this->assertEquals($query, PMA_RTN_getQueryFromRequest());
+ $this->assertEquals($num_err, count($errors));
+ }
+
+ public function provider()
+ {
+ return array(
+ // Testing success
+ array(
+ array(
+ 'item_name' => 'p r o c',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => 'SELECT 0;',
+ 'item_comment' => 'foo',
+ 'item_definer' => 'me@home',
+ 'item_type' => 'PROCEDURE',
+ 'item_num_params' => '0',
+ 'item_param_dir' => '',
+ 'item_param_name' => '',
+ 'item_param_type' => '',
+ 'item_param_length' => '',
+ 'item_param_opts_num' => '',
+ 'item_param_opts_text' => '',
+ 'item_returntype' => '',
+ 'item_isdeterministic' => '',
+ 'item_securitytype' => 'INVOKER',
+ 'item_sqldataaccess' => 'NO SQL'
+ ),
+ 'CREATE DEFINER=`me`@`home` PROCEDURE `p r o c`() COMMENT \'foo\' DETERMINISTIC NO SQL SQL SECURITY INVOKER SELECT 0;',
+ 0
+ ),
+ array(
+ array(
+ 'item_name' => 'pr``oc',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => 'SELECT \'foobar\';',
+ 'item_comment' => '',
+ 'item_definer' => 'someuser@somehost',
+ 'item_type' => 'PROCEDURE',
+ 'item_num_params' => '2',
+ 'item_param_dir' => array('IN', 'INOUT'),
+ 'item_param_name' => array('pa`ram', 'par 2'),
+ 'item_param_type' => array('INT', 'ENUM'),
+ 'item_param_length' => array('10', '\'a\', \'b\''),
+ 'item_param_opts_num' => array('ZEROFILL', ''),
+ 'item_param_opts_text' => array('utf8', 'latin1'),
+ 'item_returntype' => '',
+ 'item_securitytype' => 'DEFINER',
+ 'item_sqldataaccess' => 'foobar'
+ ),
+ 'CREATE DEFINER=`someuser`@`somehost` PROCEDURE `pr````oc`(IN `pa``ram` INT(10) ZEROFILL, INOUT `par 2` ENUM(\'a\', \'b\') CHARSET latin1) NOT DETERMINISTIC SQL SECURITY DEFINER SELECT \'foobar\';',
+ 0
+ ),
+ array(
+ array(
+ 'item_name' => 'func\\',
+ 'item_returnlength' => '5,5',
+ 'item_returnopts_num' => 'UNSIGNED ZEROFILL',
+ 'item_returnopts_text' => '',
+ 'item_definition' => 'SELECT \'foobar\';',
+ 'item_comment' => 'foo\'s bar',
+ 'item_definer' => '',
+ 'item_type' => 'FUNCTION',
+ 'item_num_params' => '1',
+ 'item_param_dir' => '',
+ 'item_param_name' => array('pa`ram'),
+ 'item_param_type' => array('VARCHAR'),
+ 'item_param_length' => array('45'),
+ 'item_param_opts_num' => array(''),
+ 'item_param_opts_text' => array('latin1'),
+ 'item_returntype' => 'DECIMAL',
+ 'item_isdeterministic' => 'ON',
+ 'item_securitytype' => 'DEFINER',
+ 'item_sqldataaccess' => 'READ SQL DATA'
+ ),
+ 'CREATE FUNCTION `func\\`(`pa``ram` VARCHAR(45) CHARSET latin1) RETURNS DECIMAL(5,5) UNSIGNED ZEROFILL COMMENT \'foo\'\'s bar\' DETERMINISTIC SQL SECURITY DEFINER SELECT \'foobar\';',
+ 0
+ ),
+ array(
+ array(
+ 'item_name' => 'func',
+ 'item_returnlength' => '20',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => 'utf8',
+ 'item_definition' => 'SELECT 0;',
+ 'item_comment' => '',
+ 'item_definer' => '',
+ 'item_type' => 'FUNCTION',
+ 'item_num_params' => '1',
+ 'item_returntype' => 'VARCHAR',
+ 'item_securitytype' => 'DEFINER',
+ 'item_sqldataaccess' => 'READ SQL DATA'
+ ),
+ 'CREATE FUNCTION `func`() RETURNS VARCHAR(20) CHARSET utf8 NOT DETERMINISTIC SQL SECURITY DEFINER SELECT 0;',
+ 0
+ ),
+ // Testing failures
+ array(
+ array(
+ ),
+ 'CREATE () NOT DETERMINISTIC ', // invalid query
+ 3
+ ),
+ array(
+ array(
+ 'item_name' => 'proc',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => 'SELECT 0;',
+ 'item_comment' => 'foo',
+ 'item_definer' => 'mehome', // invalid definer format
+ 'item_type' => 'PROCEDURE',
+ 'item_num_params' => '0',
+ 'item_param_dir' => '',
+ 'item_param_name' => '',
+ 'item_param_type' => '',
+ 'item_param_length' => '',
+ 'item_param_opts_num' => '',
+ 'item_param_opts_text' => '',
+ 'item_returntype' => '',
+ 'item_isdeterministic' => '',
+ 'item_securitytype' => 'INVOKER',
+ 'item_sqldataaccess' => 'NO SQL'
+ ),
+ 'CREATE PROCEDURE `proc`() COMMENT \'foo\' DETERMINISTIC NO SQL SQL SECURITY INVOKER SELECT 0;', // valid query
+ 1
+ ),
+ array(
+ array(
+ 'item_name' => 'proc',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => 'SELECT 0;',
+ 'item_comment' => '',
+ 'item_definer' => '',
+ 'item_type' => 'PROCEDURE',
+ 'item_num_params' => '2',
+ 'item_param_dir' => array('FAIL', 'INOUT'), // invalid direction
+ 'item_param_name' => array('pa`ram', 'goo'),
+ 'item_param_type' => array('INT', 'ENUM'),
+ 'item_param_length' => array('10', ''), // missing ENUM values
+ 'item_param_opts_num' => array('ZEROFILL', ''),
+ 'item_param_opts_text' => array('utf8', 'latin1'),
+ 'item_returntype' => '',
+ 'item_securitytype' => 'DEFINER',
+ 'item_sqldataaccess' => 'foobar' // invalid, will just be ignored withour throwing errors
+ ),
+ 'CREATE PROCEDURE `proc`((10) ZEROFILL, INOUT `goo` ENUM CHARSET latin1) NOT DETERMINISTIC SQL SECURITY DEFINER SELECT 0;', // invalid query
+ 2
+ ),
+ array(
+ array(
+ 'item_name' => 'func',
+ 'item_returnlength' => '', // missing length for VARCHAR
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => 'utf8',
+ 'item_definition' => 'SELECT 0;',
+ 'item_comment' => '',
+ 'item_definer' => '',
+ 'item_type' => 'FUNCTION',
+ 'item_num_params' => '2',
+ 'item_param_dir' => array('IN'),
+ 'item_param_name' => array(''), // missing name
+ 'item_param_type' => array('INT'),
+ 'item_param_length' => array('10'),
+ 'item_param_opts_num' => array('ZEROFILL'),
+ 'item_param_opts_text' => array('latin1'),
+ 'item_returntype' => 'VARCHAR',
+ 'item_securitytype' => 'DEFINER',
+ 'item_sqldataaccess' => ''
+ ),
+ 'CREATE FUNCTION `func`() RETURNS VARCHAR CHARSET utf8 NOT DETERMINISTIC SQL SECURITY DEFINER SELECT 0;', // invalid query
+ 2
+ ),
+ array(
+ array(
+ 'item_name' => 'func',
+ 'item_returnlength' => '',
+ 'item_returnopts_num' => '',
+ 'item_returnopts_text' => '',
+ 'item_definition' => 'SELECT 0;',
+ 'item_comment' => '',
+ 'item_definer' => '',
+ 'item_type' => 'FUNCTION',
+ 'item_num_params' => '0',
+ 'item_returntype' => 'FAIL', // invalid return type
+ 'item_securitytype' => 'DEFINER',
+ 'item_sqldataaccess' => ''
+ ),
+ 'CREATE FUNCTION `func`() NOT DETERMINISTIC SQL SECURITY DEFINER SELECT 0;', // invalid query
+ 1
+ ),
+ );
+ }
+}
+?>
diff --git a/test/libraries/rte/PMA_TRI_getDataFromRequest_test.php b/test/libraries/rte/PMA_TRI_getDataFromRequest_test.php
new file mode 100644
index 0000000..af10eaa
--- /dev/null
+++ b/test/libraries/rte/PMA_TRI_getDataFromRequest_test.php
@@ -0,0 +1,78 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for fetching trigger data from HTTP request
+ *
+ * @package phpMyAdmin-test
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/rte/rte_triggers.lib.php';
+
+class PMA_TRI_getDataFromRequest_test extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @dataProvider provider
+ */
+ public function testgetDataFromRequest_empty($in, $out)
+ {
+ global $_REQUEST;
+
+ unset($_REQUEST);
+ foreach ($in as $key => $value) {
+ if ($value !== '') {
+ $_REQUEST[$key] = $value;
+ }
+ }
+ $this->assertEquals($out, PMA_TRI_getDataFromRequest());
+ }
+
+ public function provider()
+ {
+ return array(
+ array(
+ array(
+ 'item_name' => '',
+ 'item_table' => '',
+ 'item_original_name' => '',
+ 'item_action_timing' => '',
+ 'item_event_manipulation' => '',
+ 'item_definition' => '',
+ 'item_definer' => ''
+ ),
+ array(
+ 'item_name' => '',
+ 'item_table' => '',
+ 'item_original_name' => '',
+ 'item_action_timing' => '',
+ 'item_event_manipulation' => '',
+ 'item_definition' => '',
+ 'item_definer' => ''
+ )
+ ),
+ array(
+ array(
+ 'item_name' => 'foo',
+ 'item_table' => 'foo',
+ 'item_original_name' => 'foo',
+ 'item_action_timing' => 'foo',
+ 'item_event_manipulation' => 'foo',
+ 'item_definition' => 'foo',
+ 'item_definer' => 'foo'
+ ),
+ array(
+ 'item_name' => 'foo',
+ 'item_table' => 'foo',
+ 'item_original_name' => 'foo',
+ 'item_action_timing' => 'foo',
+ 'item_event_manipulation' => 'foo',
+ 'item_definition' => 'foo',
+ 'item_definer' => 'foo'
+ )
+ )
+ );
+ }
+}
+?>
diff --git a/test/libraries/rte/PMA_TRI_getEditorForm_test.php b/test/libraries/rte/PMA_TRI_getEditorForm_test.php
new file mode 100644
index 0000000..53dc510
--- /dev/null
+++ b/test/libraries/rte/PMA_TRI_getEditorForm_test.php
@@ -0,0 +1,289 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for generating trigger editor
+ *
+ * @package phpMyAdmin-test
+ */
+require_once 'libraries/php-gettext/gettext.inc';
+require_once 'libraries/url_generating.lib.php';
+require_once 'libraries/common.lib.php';
+/*
+ * Include to test.
+ */
+require_once 'libraries/rte/rte_triggers.lib.php';
+
+class PMA_TRI_getEditorForm_test extends PHPUnit_Framework_TestCase
+{
+ public function setUp()
+ {
+ if (! function_exists('PMA_DBI_get_tables')) {
+ function PMA_DBI_get_tables($db)
+ {
+ return array('table1', 'table`2');
+ }
+ }
+ $GLOBALS['tear_down']['token'] = false;
+ $GLOBALS['tear_down']['server'] = false;
+ if (! isset($_SESSION[' PMA_token '])) {
+ $_SESSION[' PMA_token '] = '';
+ $GLOBALS['tear_down']['token'] = true;
+ }
+ if (! isset($GLOBALS['cfg']['ServerDefault'])) {
+ $GLOBALS['cfg']['ServerDefault'] = '';
+ $GLOBALS['tear_down']['server'] = true;
+ }
+ }
+
+ public function tearDown()
+ {
+ if ($GLOBALS['tear_down']['token']) {
+ unset($_SESSION[' PMA_token ']);
+ }
+ if ($GLOBALS['tear_down']['server']) {
+ unset($GLOBALS['cfg']['ServerDefault']);
+ }
+ unset($GLOBALS['tear_down']);
+ }
+
+ /**
+ * @dataProvider provider_add
+ */
+ public function testgetEditorForm_add($data, $matcher)
+ {
+ $GLOBALS['is_ajax_request'] = false;
+ PMA_TRI_setGlobals();
+ $this->assertTag($matcher, PMA_TRI_getEditorForm('add', $data), '', false);
+ }
+
+ public function provider_add()
+ {
+ $data = array(
+ 'item_name' => '',
+ 'item_table' => 'table1',
+ 'item_original_name' => '',
+ 'item_action_timing' => '',
+ 'item_event_manipulation' => '',
+ 'item_definition' => '',
+ 'item_definer' => ''
+ );
+
+ return array(
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'add_item'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_name'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_table'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_timing'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_event'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'textarea',
+ 'attributes' => array(
+ 'name' => 'item_definition'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_definer'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'editor_process_add'
+ )
+ )
+ )
+ );
+ }
+
+ /**
+ * @dataProvider provider_edit
+ */
+ public function testgetEditorForm_edit($data, $matcher)
+ {
+ $GLOBALS['is_ajax_request'] = false;
+ PMA_TRI_setGlobals();
+ $this->assertTag($matcher, PMA_TRI_getEditorForm('edit', $data), '', false);
+ }
+
+ public function provider_edit()
+ {
+ $data = array(
+ 'item_name' => 'foo',
+ 'item_table' => 'table1',
+ 'item_original_name' => 'bar',
+ 'item_action_timing' => 'BEFORE',
+ 'item_event_manipulation' => 'INSERT',
+ 'item_definition' => 'SET @A=1;',
+ 'item_definer' => ''
+ );
+
+ return array(
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'edit_item'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_name'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_table'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_timing'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'select',
+ 'attributes' => array(
+ 'name' => 'item_event'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'textarea',
+ 'attributes' => array(
+ 'name' => 'item_definition'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'item_definer'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'editor_process_edit'
+ )
+ )
+ )
+ );
+ }
+
+ /**
+ * @dataProvider provider_ajax
+ */
+ public function testgetEditorForm_ajax($data, $matcher)
+ {
+ $GLOBALS['is_ajax_request'] = true;
+ PMA_TRI_setGlobals();
+ $this->assertTag($matcher, PMA_TRI_getEditorForm('edit', $data), '', false);
+ }
+
+ public function provider_ajax()
+ {
+ $data = array(
+ 'item_name' => 'foo',
+ 'item_table' => 'table1',
+ 'item_original_name' => 'bar',
+ 'item_action_timing' => 'BEFORE',
+ 'item_event_manipulation' => 'INSERT',
+ 'item_definition' => 'SET @A=1;',
+ 'item_definer' => ''
+ );
+
+ return array(
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'editor_process_edit'
+ )
+ )
+ ),
+ array(
+ $data,
+ array(
+ 'tag' => 'input',
+ 'attributes' => array(
+ 'name' => 'ajax_request'
+ )
+ )
+ )
+ );
+ }
+}
+?>
diff --git a/test/libraries/rte/PMA_TRI_getQueryFromRequest_test.php b/test/libraries/rte/PMA_TRI_getQueryFromRequest_test.php
new file mode 100644
index 0000000..d6e18ad
--- /dev/null
+++ b/test/libraries/rte/PMA_TRI_getQueryFromRequest_test.php
@@ -0,0 +1,103 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Test for generating CREATE TRIGGER query from HTTP request
+ *
+ * @package phpMyAdmin-test
+ */
+
+/*
+ * Needed for PMA_backquote()
+ */
+require_once 'libraries/common.lib.php';
+
+/*
+ * Needed by PMA_TRI_getQueryFromRequest()
+ */
+require_once 'libraries/php-gettext/gettext.inc';
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/rte/rte_triggers.lib.php';
+
+
+class PMA_TRI_getQueryFromRequest_test extends PHPUnit_Framework_TestCase
+{
+ public function setUp()
+ {
+ if (! function_exists('PMA_DBI_get_tables')) {
+ function PMA_DBI_get_tables($db)
+ {
+ return array('table1', 'table`2');
+ }
+ }
+ }
+
+ /**
+ * @dataProvider provider
+ */
+ public function testgetQueryFromRequest($definer, $name, $timing, $event, $table, $definition, $query, $num_err)
+ {
+ global $_REQUEST, $errors;
+
+ $errors = array();
+ PMA_TRI_setGlobals();
+
+ $_REQUEST['item_definer'] = $definer;
+ $_REQUEST['item_name'] = $name;
+ $_REQUEST['item_timing'] = $timing;
+ $_REQUEST['item_event'] = $event;
+ $_REQUEST['item_table'] = $table;
+ $_REQUEST['item_definition'] = $definition;
+
+ $this->assertEquals($query, PMA_TRI_getQueryFromRequest());
+ $this->assertEquals($num_err, count($errors));
+ }
+
+ public function provider()
+ {
+ return array(
+ array('',
+ '',
+ '',
+ '',
+ '',
+ '',
+ 'CREATE TRIGGER ON FOR EACH ROW ',
+ 5
+ ),
+ array(
+ 'root',
+ 'trigger',
+ 'BEFORE',
+ 'INSERT',
+ 'table`2',
+ 'SET @A=NULL',
+ 'CREATE TRIGGER `trigger` BEFORE INSERT ON `table``2` FOR EACH ROW SET @A=NULL',
+ 1
+ ),
+ array(
+ 'foo`s@host',
+ 'trigger`s test',
+ 'AFTER',
+ 'foo',
+ 'table3',
+ 'BEGIN SET @A=1; SET @B=2; END',
+ 'CREATE DEFINER=`foo``s`@`host` TRIGGER `trigger``s test` AFTER ON FOR EACH ROW BEGIN SET @A=1; SET @B=2; END',
+ 2
+ ),
+ array(
+ 'root@localhost',
+ 'trigger',
+ 'BEFORE',
+ 'INSERT',
+ 'table1',
+ 'SET @A=NULL',
+ 'CREATE DEFINER=`root`@`localhost` TRIGGER `trigger` BEFORE INSERT ON `table1` FOR EACH ROW SET @A=NULL',
+ 0
+ ),
+ );
+ }
+}
+?>
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-11694-g60fdffb
by Michal Čihař 22 Jul '11
by Michal Čihař 22 Jul '11
22 Jul '11
The branch, master has been updated
via 60fdffbafaa32ba629638894f42403d34b53de20 (commit)
via eed246438e9d6f164d8208f0c01482d2c429e62a (commit)
via 33df35fd6b133ecb07be107937ebf328f5de1244 (commit)
via 896519cf77b73234ded21f8c81f95ec931bcaeac (commit)
from dc218032df2896d173334304e8ff673709012ea6 (commit)
- Log -----------------------------------------------------------------
commit 60fdffbafaa32ba629638894f42403d34b53de20
Merge: dc218032df2896d173334304e8ff673709012ea6 eed246438e9d6f164d8208f0c01482d2c429e62a
Author: Michal Čihař <mcihar(a)suse.cz>
Date: Fri Jul 22 11:56:33 2011 +0200
Merge remote-tracking branch 'rouslan/rte'
commit eed246438e9d6f164d8208f0c01482d2c429e62a
Merge: 33df35fd6b133ecb07be107937ebf328f5de1244 49b2ca984a6c38fa7b49aeff3f1344d837cf5834
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Thu Jul 21 20:11:24 2011 +0100
Merge branch 'master' into rte
commit 33df35fd6b133ecb07be107937ebf328f5de1244
Merge: 896519cf77b73234ded21f8c81f95ec931bcaeac fd121f211a805e6cb83b51f5087ac79e7791dbba
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Thu Jul 21 14:54:41 2011 +0100
Merge branch 'master' into rte
commit 896519cf77b73234ded21f8c81f95ec931bcaeac
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Thu Jul 21 14:52:30 2011 +0100
E_ALL fix
-----------------------------------------------------------------------
Summary of changes:
libraries/rte/rte_routines.lib.php | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libraries/rte/rte_routines.lib.php b/libraries/rte/rte_routines.lib.php
index 9a99b8c..2edb4ca 100644
--- a/libraries/rte/rte_routines.lib.php
+++ b/libraries/rte/rte_routines.lib.php
@@ -1356,6 +1356,8 @@ function PMA_RTN_getExecuteForm($routine)
}
$retval .= "<th>" . __('Value') . "</th>\n";
$retval .= "</tr>\n";
+ // Get a list of data types that are not yet supported.
+ $no_support_types = PMA_unsupportedDatatypes();
for ($i=0; $i<$routine['item_num_params']; $i++) { // Each parameter
if ($routine['item_type'] == 'PROCEDURE'
&& $routine['item_param_dir'][$i] == 'OUT'
@@ -1368,8 +1370,6 @@ function PMA_RTN_getExecuteForm($routine)
$retval .= "<td>{$routine['item_param_type'][$i]}</td>\n";
if ($cfg['ShowFunctionFields']) {
$retval .= "<td>\n";
- // Get a list of data types that are not yet supported.
- $no_support_types = PMA_unsupportedDatatypes();
if (stristr($routine['item_param_type'][$i], 'enum')
|| stristr($routine['item_param_type'][$i], 'set')
|| in_array(strtolower($routine['item_param_type'][$i]), $no_support_types)
hooks/post-receive
--
phpMyAdmin
1
0