Révision d808fa20
Ajouté par Assos Assos il y a plus de 6 ans
drupal7/sites/all/modules/feeds_tamper/tests/feeds_tamper_plugins.test | ||
---|---|---|
1165 | 1165 |
} |
1166 | 1166 |
|
1167 | 1167 |
} |
1168 |
|
|
1169 |
/** |
|
1170 |
* Tests for the Tamper plugin 'encode'. |
|
1171 |
*/ |
|
1172 |
class FeedsTamperEncodeDecodeTestCase extends FeedsTamperUnitTestCase { |
|
1173 |
|
|
1174 |
/** |
|
1175 |
* The ID of the plugin to be tested. |
|
1176 |
* |
|
1177 |
* @var string |
|
1178 |
*/ |
|
1179 |
protected $plugin_id = 'encode'; |
|
1180 |
|
|
1181 |
/** |
|
1182 |
* {@inheritdoc} |
|
1183 |
*/ |
|
1184 |
public static function getInfo() { |
|
1185 |
return array( |
|
1186 |
'name' => 'Plugins: Encode', |
|
1187 |
'description' => 'Unit tests for "Encode/Decode" plugin.', |
|
1188 |
'group' => 'Feeds Tamper', |
|
1189 |
); |
|
1190 |
} |
|
1191 |
|
|
1192 |
/** |
|
1193 |
* {@inheritdoc} |
|
1194 |
*/ |
|
1195 |
public function test() { |
|
1196 |
$this->execute(array(), 'a:0:{}', array('mode' => 'serialize')); |
|
1197 |
$this->execute('a:0:{}', array(), array('mode' => 'unserialize')); |
|
1198 |
|
|
1199 |
$this->execute('abcdef 123 @#`|\\"$%&/()=?\'^*', 's:28:"abcdef 123 @#`|\"$%&/()=?\'^*";', array('mode' => 'serialize')); |
|
1200 |
$this->execute('s:28:"abcdef 123 @#`|\"$%&/()=?\'^*";', 'abcdef 123 @#`|\"$%&/()=?\'^*', array('mode' => 'unserialize')); |
|
1201 |
|
|
1202 |
$this->execute('abcdef 123 @#`|\\"$%&/()=?\'^*', 'YWJjZGVmIDEyMyBAI2B8XCIkJSYvKCk9PydeKg==', array('mode' => 'base64_encode')); |
|
1203 |
$this->execute('YWJjZGVmIDEyMyBAI2B8XCIkJSYvKCk9PydeKg==', 'abcdef 123 @#`|\\"$%&/()=?\'^*', array('mode' => 'base64_decode')); |
|
1204 |
} |
|
1205 |
|
|
1206 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules