You are here

protected function HashTest::getMockItem in Tamper 8

Get a mock item to use in the test.

Return value

\Drupal\tamper\TamperableItemInterface|\PHPUnit_Framework_MockObject_MockObject The mock of a tamperable item to use in the test.

2 calls to HashTest::getMockItem()
HashTest::testHash in tests/src/Unit/Plugin/Tamper/HashTest.php
Test the hash functionality.
HashTest::testHashWithOverride in tests/src/Unit/Plugin/Tamper/HashTest.php
Test the hash functionality.

File

tests/src/Unit/Plugin/Tamper/HashTest.php, line 30

Class

HashTest
Tests the hash plugin.

Namespace

Drupal\Tests\tamper\Unit\Plugin\Tamper

Code

protected function getMockItem() {
  $item = $this
    ->createMock(TamperableItemInterface::class);
  $item
    ->expects($this
    ->any())
    ->method('getSource')
    ->willReturn([
    'title' => 'Yay title!',
    'body' => 'Yay body!',
    'foo' => 'bar',
  ]);
  return $item;
}