Commit e15fce6d authored by catch's avatar catch

Issue #2938799 by claudiu.cristea: Provide the timestamp scalar data type

parent 1d0dce84
......@@ -28,6 +28,9 @@ email:
integer:
label: 'Integer'
class: '\Drupal\Core\TypedData\Plugin\DataType\IntegerData'
timestamp:
label: 'Timestamp'
class: '\Drupal\Core\TypedData\Plugin\DataType\Timestamp'
float:
label: 'Float'
class: '\Drupal\Core\TypedData\Plugin\DataType\FloatData'
......
langcode: en
status: true
dependencies:
config:
- field.storage.entity_test.timestamp
id: entity_test.entity_test.timestamp
field_name: timestamp
entity_type: entity_test
bundle: entity_test
label: 'Time stamp'
description: ''
required: false
translatable: false
default_value:
-
value: 1514847537
default_value_callback: ''
settings: { }
field_type: timestamp
langcode: en
status: true
dependencies:
module:
- entity_test
id: node.timestamp
field_name: timestamp
entity_type: entity_test
type: timestamp
settings: { }
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
name: 'Field Timestamp Test'
type: module
description: 'Support module for the Timestamp field item test.'
core: 8.x
package: Testing
version: VERSION
dependencies:
- entity_test
- field
<?php
namespace Drupal\KernelTests\Core\Datetime;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests timestamp schema.
*
* @group Common
*/
class TimestampSchemaTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = ['entity_test', 'field', 'field_timestamp_test'];
/**
* Tests if the timestamp field schema is validated.
*/
public function testTimestampSchema() {
$this->installConfig(['field_timestamp_test']);
// Make at least an assertion.
$this->assertTrue(TRUE);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment