diff --git a/test/bootstrap-dist.php b/test/bootstrap-dist.php
index 209a05ed6f..0c49c9805a 100644
--- a/test/bootstrap-dist.php
+++ b/test/bootstrap-dist.php
@@ -121,34 +121,6 @@ if (PMA_HAS_RUNKIT && $GLOBALS['runkit_internal_override']) {
echo "Please install runkit and enable runkit.internal_override!\n";
}
-/**
- * Return the tag array to be used with assertTag by parsing
- * a given HTML element
- *
- * @param string $elementHTML HTML for element to be parsed
- * @param array $arr Additional array elements like content, parent
- *
- * @return array Tag array to be used with assertTag
- */
-function PMA_getTagArray($elementHTML, $arr = array())
-{
-
- // get attributes
- preg_match_all("/\s+(.*?)\=\s*\"(.*?)\"/is", $elementHTML, $matches);
- foreach ($matches[1] as $key => $val) {
- $arr['attributes'][trim($val)] = trim($matches[2][$key]);
- }
- $matches = array();
-
- // get tag
- preg_match("/^\<(.*?)(\s|\>)/i", $elementHTML, $matches);
- if (isset($matches[1])) {
- $arr['tag'] = trim($matches[1]);
- }
-
- return $arr;
-}
-
/**
* Overrides date function
*
diff --git a/test/libraries/rte/PMA_RTN_getExecuteForm_test.php b/test/libraries/rte/PMA_RTN_getExecuteForm_test.php
index 31688ebe29..4ac10f5285 100644
--- a/test/libraries/rte/PMA_RTN_getExecuteForm_test.php
+++ b/test/libraries/rte/PMA_RTN_getExecuteForm_test.php
@@ -58,7 +58,10 @@ class PMA_RTN_GetExecuteForm_Test extends PHPUnit_Framework_TestCase
{
$GLOBALS['is_ajax_request'] = false;
PMA_RTN_setGlobals();
- $this->assertTag($matcher, PMA_RTN_getExecuteForm($data), false);
+ $this->assertContains(
+ $matcher,
+ PMA_RTN_getExecuteForm($data)
+ );
}
/**
@@ -136,77 +139,35 @@ class PMA_RTN_GetExecuteForm_Test extends PHPUnit_Framework_TestCase
return array(
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'item_name'
- )
- )
+ "name='item_name'"
),
array(
$data,
- array(
- 'tag' => 'select',
- 'attributes' => array(
- 'name' => 'funcs[foo]'
- )
- )
+ "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]'
- )
- )
+ "name='funcs[fob]'"
),
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'params[fob]',
- 'class' => 'datetimefield'
- )
- )
+ " 'input',
- 'attributes' => array(
- 'name' => 'params[fod][]'
- ),
- )
+ "name='params[fod][]'"
),
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'params[foe][]'
- ),
- )
+ "name='params[foe][]'"
),
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'execute_routine'
- )
- )
+ "name='execute_routine'"
),
);
}
@@ -225,7 +186,10 @@ class PMA_RTN_GetExecuteForm_Test extends PHPUnit_Framework_TestCase
{
$GLOBALS['is_ajax_request'] = true;
PMA_RTN_setGlobals();
- $this->assertTag($matcher, PMA_RTN_getExecuteForm($data), false);
+ $this->assertContains(
+ $matcher,
+ PMA_RTN_getExecuteForm($data)
+ );
}
/**
@@ -303,21 +267,11 @@ class PMA_RTN_GetExecuteForm_Test extends PHPUnit_Framework_TestCase
return array(
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'execute_routine'
- )
- )
+ "name='execute_routine'"
),
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'ajax_request'
- )
- )
+ "name='ajax_request'"
),
);
}
diff --git a/test/libraries/rte/PMA_TRI_getEditorForm_test.php b/test/libraries/rte/PMA_TRI_getEditorForm_test.php
index e55be5068f..628c8ce2e2 100644
--- a/test/libraries/rte/PMA_TRI_getEditorForm_test.php
+++ b/test/libraries/rte/PMA_TRI_getEditorForm_test.php
@@ -50,7 +50,10 @@ class PMA_TRI_GetEditorForm_Test extends PHPUnit_Framework_TestCase
{
$GLOBALS['is_ajax_request'] = false;
PMA_TRI_setGlobals();
- $this->assertTag($matcher, PMA_TRI_getEditorForm('add', $data), '', false);
+ $this->assertContains(
+ $matcher,
+ PMA_TRI_getEditorForm('add', $data)
+ );
}
/**
@@ -73,75 +76,35 @@ class PMA_TRI_GetEditorForm_Test extends PHPUnit_Framework_TestCase
return array(
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'add_item'
- )
- )
+ "name='add_item'"
),
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'item_name'
- )
- )
+ "name='item_name'"
),
array(
$data,
- array(
- 'tag' => 'select',
- 'attributes' => array(
- 'name' => 'item_table'
- )
- )
+ "name='item_table'"
),
array(
$data,
- array(
- 'tag' => 'select',
- 'attributes' => array(
- 'name' => 'item_timing'
- )
- )
+ "name='item_timing'"
),
array(
$data,
- array(
- 'tag' => 'select',
- 'attributes' => array(
- 'name' => 'item_event'
- )
- )
+ "name='item_event'"
),
array(
$data,
- array(
- 'tag' => 'textarea',
- 'attributes' => array(
- 'name' => 'item_definition'
- )
- )
+ "name='item_definition'"
),
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'item_definer'
- )
- )
+ "name='item_definer'"
),
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'editor_process_add'
- )
- )
+ "name='editor_process_add'"
)
);
}
@@ -161,7 +124,10 @@ class PMA_TRI_GetEditorForm_Test extends PHPUnit_Framework_TestCase
{
$GLOBALS['is_ajax_request'] = false;
PMA_TRI_setGlobals();
- $this->assertTag($matcher, PMA_TRI_getEditorForm('edit', $data), '', false);
+ $this->assertContains(
+ $matcher,
+ PMA_TRI_getEditorForm('edit', $data)
+ );
}
/**
@@ -184,75 +150,35 @@ class PMA_TRI_GetEditorForm_Test extends PHPUnit_Framework_TestCase
return array(
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'edit_item'
- )
- )
+ "name='edit_item'"
),
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'item_name'
- )
- )
+ "name='item_name'"
),
array(
$data,
- array(
- 'tag' => 'select',
- 'attributes' => array(
- 'name' => 'item_table'
- )
- )
+ "name='item_table'"
),
array(
$data,
- array(
- 'tag' => 'select',
- 'attributes' => array(
- 'name' => 'item_timing'
- )
- )
+ "name='item_timing'"
),
array(
$data,
- array(
- 'tag' => 'select',
- 'attributes' => array(
- 'name' => 'item_event'
- )
- )
+ "name='item_event'"
),
array(
$data,
- array(
- 'tag' => 'textarea',
- 'attributes' => array(
- 'name' => 'item_definition'
- )
- )
+ "name='item_definition'"
),
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'item_definer'
- )
- )
+ "name='item_definer'"
),
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'editor_process_edit'
- )
- )
+ "name='editor_process_edit'"
)
);
}
@@ -271,7 +197,10 @@ class PMA_TRI_GetEditorForm_Test extends PHPUnit_Framework_TestCase
{
$GLOBALS['is_ajax_request'] = true;
PMA_TRI_setGlobals();
- $this->assertTag($matcher, PMA_TRI_getEditorForm('edit', $data), '', false);
+ $this->assertContains(
+ $matcher,
+ PMA_TRI_getEditorForm('edit', $data)
+ );
}
/**
@@ -294,21 +223,11 @@ class PMA_TRI_GetEditorForm_Test extends PHPUnit_Framework_TestCase
return array(
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'editor_process_edit'
- )
- )
+ "name='editor_process_edit'"
),
array(
$data,
- array(
- 'tag' => 'input',
- 'attributes' => array(
- 'name' => 'ajax_request'
- )
- )
+ "name='ajax_request'"
)
);
}