X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fmodules%2Fentity_test%2Fsrc%2FPlugin%2FField%2FFieldType%2FChangedTestItem.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fmodules%2Fentity_test%2Fsrc%2FPlugin%2FField%2FFieldType%2FChangedTestItem.php;h=1425588fc4dc0f221a81167624cd765f160b9f9b;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ChangedTestItem.php b/web/core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ChangedTestItem.php new file mode 100644 index 000000000..1425588fc --- /dev/null +++ b/web/core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ChangedTestItem.php @@ -0,0 +1,39 @@ +value == REQUEST_TIME) { + // During a test the request time is immutable. To allow tests of the + // algorithm of + // Drupal\Core\Field\Plugin\Field\FieldType\ChangedItem::preSave() we need + // to set a real time value here. + $this->value = time(); + } + } + +}