You are here

public function MathTest::testFlipDivision in Tamper 8

Test flip out with division.

File

tests/src/Unit/Plugin/Tamper/MathTest.php, line 93

Class

MathTest
Tests the math plugin.

Namespace

Drupal\Tests\tamper\Unit\Plugin\Tamper

Code

public function testFlipDivision() {
  $config = [
    Math::SETTING_OPERATION => 'division',
    Math::SETTING_FLIP => TRUE,
    Math::SETTING_VALUE => 3,
  ];
  $plugin = new Math($config, 'math', [], $this
    ->getMockSourceDefinition());
  $this
    ->assertEquals(3 / 2, $plugin
    ->tamper(2));
}