public function Drupal8Test::providerSetEntityProperty in Realistic Dummy Content 3.x
Provider for testSetEntityProperty().
File
- api/
tests/ src/ Unit/ Framework/ Drupal8Test.php, line 55
Class
Namespace
Drupal\Tests\realistic_dummy_content_api\Unit\FrameworkCode
public function providerSetEntityProperty() {
// @codingStandardsIgnoreStart
$class1 = new class {
function set($param, $value) {
$this->{$param} = $value;
}
};
// @codingStandardsIgnoreEnd
$class2 = $class1;
$class2->whatever = "Hello World";
return [
[
'message' => 'Base case',
'entity' => $class1,
'property' => 'whatever',
'value' => 'Hello World',
'expected' => $class2,
],
[
'message' => 'Value has "set" property',
'entity' => $class1,
'property' => 'whatever',
'value' => [
'set' => 'Hello World',
],
'expected' => $class2,
],
];
}