public function ConvertBooleanTest::testConvertBooleanNoMatchTrue in Tamper 8
Test convert to boolean no match true case.
File
- tests/
src/ Unit/ Plugin/ Tamper/ ConvertBooleanTest.php, line 64
Class
- ConvertBooleanTest
- Tests the convert boolean plugin.
Namespace
Drupal\Tests\tamper\Unit\Plugin\TamperCode
public function testConvertBooleanNoMatchTrue() {
$config = [
ConvertBoolean::SETTING_TRUTH_VALUE => 'A',
ConvertBoolean::SETTING_FALSE_VALUE => 'B',
ConvertBoolean::SETTING_MATCH_CASE => TRUE,
ConvertBoolean::SETTING_NO_MATCH => 'No match',
ConvertBoolean::SETTING_OTHER_TEXT => '',
];
$plugin = new ConvertBoolean($config, 'convert_boolean', [], $this
->getMockSourceDefinition());
$this
->assertEquals(TRUE, $plugin
->tamper('A'));
$this
->assertNotEquals(TRUE, $plugin
->tamper('a'));
$this
->assertEquals(FALSE, $plugin
->tamper('B'));
$this
->assertNotEquals(FALSE, $plugin
->tamper('b'));
}