public function DefaultFieldComparatorTest::testImageWithoutAltWithTitleFieldProperties in Changed Fields API 8.3
Default field comparator: image field's property(s).
Test image field properties without alt but with title.
File
- tests/
src/ Unit/ DefaultFieldComparatorTest.php, line 362
Class
- DefaultFieldComparatorTest
- @coversDefaultClass \Drupal\changed_fields\Plugin\FieldComparator\DefaultFieldComparator
Namespace
Drupal\Tests\changed_fields\UnitCode
public function testImageWithoutAltWithTitleFieldProperties() {
$this->fieldDefinitionMock
->expects($this
->once())
->method('getType')
->willReturn('image');
$this->fieldDefinitionMock
->expects($this
->at(2))
->method('getSetting')
->with('title_field')
->willReturn(TRUE);
$properties = $this
->invokeMethod($this->fieldComparator, 'getComparableProperties', [
$this->fieldDefinitionMock,
]);
$this
->assertArrayEquals([
'width',
'height',
'target_id',
'title',
], $properties);
}