function ComputedFileUrlTest::testSetValueNoNotify
@covers ::setValue
      
    
File
- 
              core/
modules/ file/ tests/ src/ Kernel/ ComputedFileUrlTest.php, line 77  
Class
- ComputedFileUrlTest
 - @coversDefaultClass \Drupal\file\ComputedFileUrl[[api-linebreak]]
 
Namespace
Drupal\Tests\file\KernelCode
public function testSetValueNoNotify() : void {
  $name = $this->randomMachineName();
  $parent = $this->prophesize(FieldItemInterface::class);
  $parent->onChange($name)
    ->shouldNotBeCalled();
  $definition = $this->prophesize(DataDefinitionInterface::class);
  $typed_data = new ComputedFileUrl($definition->reveal(), $name, $parent->reveal());
  // Setting the value should explicitly should mean the parent entity is
  // never called into.
  $typed_data->setValue($this->testUrl, FALSE);
  $this->assertSame($this->testUrl, $typed_data->getValue());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.