public function MathTest::testInvalidDataUntouched in Tamper 8
Test invalid data throws exception.
File
- tests/
src/ Unit/ Plugin/ Tamper/ MathTest.php, line 121
Class
- MathTest
- Tests the math plugin.
Namespace
Drupal\Tests\tamper\Unit\Plugin\TamperCode
public function testInvalidDataUntouched() {
$this
->expectException(TamperException::class, 'Math plugin failed because data was not numeric.');
$config = [
Math::SETTING_OPERATION => 'subtraction',
Math::SETTING_FLIP => TRUE,
Math::SETTING_VALUE => 3,
];
$plugin = new Math($config, 'math', [], $this
->getMockSourceDefinition());
$plugin
->tamper('boo');
}