' . "\n"
. 'select *' . "\n"
. '
'
),
array(
new Text_Plain_Link(),
array(
'PMA_TXT_LINK',
array("./php/", "text_name")
),
'./php/PMA_TXT_LINK'
),
array(
new Text_Plain_Link(),
array(
'PMA_TXT_LINK',
array(),
),
'PMA_TXT_LINK'
),
array(
new Text_Plain_Link(),
array(
'https://example.com/PMA_TXT_LINK',
array(),
),
'https://example.com/PMA_TXT_LINK'
),
array(
new Text_Plain_Link(),
array(
'PMA_TXT_LINK',
array("./php/", "text_name")
),
'./php/PMA_TXT_LINK'
),
array(
new Text_Plain_Longtoipv4(),
array(
42949672,
array("option1", "option2")
),
'2.143.92.40'
),
array(
new Text_Plain_Longtoipv4(),
array(
4294967295,
array("option1", "option2")
),
'255.255.255.255'
),
array(
new Text_Plain_PreApPend(),
array(
'My',
array('php', 'Admin')
),
'phpMyAdmin'
),
array(
new Text_Plain_Substring(),
array(
'PMA_BUFFER',
array(1, 3, 'suffix')
),
'suffixMA_suffix'
),
);
}
/**
* Tests for applyTransformation, isSuccess, getError
*
* @param object $object instance of the plugin
* @param array $applyArgs arguments for applyTransformation
* @param string $transformed the expected output of applyTransformation
* @param bool $success the expected output of isSuccess
* @param string $error the expected output of getError
*
* @return void
*
* @dataProvider transformationDataProvider
* @group medium
*/
public function testTransformation(
$object, $applyArgs, $transformed, $success = true, $error = ''
) {
$reflectionMethod = new ReflectionMethod($object, 'applyTransformation');
$this->assertEquals(
$transformed,
$reflectionMethod->invokeArgs($object, $applyArgs)
);
// For output transformation plugins, this method may not exist
if (method_exists($object, 'isSuccess')) {
$this->assertEquals(
$success,
$object->isSuccess()
);
}
// For output transformation plugins, this method may not exist
if (method_exists($object, 'getError')) {
$this->assertEquals(
$error,
$object->getError()
);
}
}
}