public function HashTest::testHash in Tamper 8
Test the hash functionality.
File
- tests/
src/ Unit/ Plugin/ Tamper/ HashTest.php, line 45
Class
- HashTest
- Tests the hash plugin.
Namespace
Drupal\Tests\tamper\Unit\Plugin\TamperCode
public function testHash() {
$hashed_values = md5(serialize([
'title' => 'Yay title!',
'body' => 'Yay body!',
'foo' => 'bar',
]));
$this
->assertEquals($hashed_values, $this->plugin
->tamper('', $this
->getMockItem()));
$this
->assertEquals('foo', $this->plugin
->tamper('foo', $this
->getMockItem()));
}