public function FeedsTamperCovertBooleanTestCase::test in Feeds Tamper 6
Same name and namespace in other branches
- 7 tests/feeds_tamper_plugins.test \FeedsTamperCovertBooleanTestCase::test()
File
- tests/
feeds_tamper_plugins.test, line 156 - Unit tests for feeds tamper plugins.
Class
Code
public function test() {
$settings = array(
'true_value' => 'A',
'false_value' => 'B',
'match_case' => FALSE,
'no_match' => 'false',
);
// Basic functionality.
$this
->execute('A', TRUE, $settings);
$this
->execute('B', FALSE, $settings);
// match_case = FALSE works.
$this
->execute('a', TRUE, $settings);
$this
->execute('b', FALSE, $settings);
// no_match = false
$this
->execute('c', FALSE, $settings);
$settings['no_match'] = 'pass';
$this
->execute('c', 'c', $settings);
// match_case = TRUE
$settings['match_case'] = TRUE;
$settings['no_match'] = 'false';
$this
->execute('a', FALSE, $settings);
// no_match = NULL.
$settings['no_match'] = 'null';
$this
->execute('a', NULL, $settings);
// other_text = 'other text'.
$settings['no_match'] = 'other';
$settings['other_text'] = 'other text';
$this
->execute('a', 'other text', $settings);
}