Issue #2938799 by claudiu.cristea: Provide the timestamp scalar data type
parent
1d0dce8408
commit
e15fce6d02
|
@ -28,6 +28,9 @@ email:
|
||||||
integer:
|
integer:
|
||||||
label: 'Integer'
|
label: 'Integer'
|
||||||
class: '\Drupal\Core\TypedData\Plugin\DataType\IntegerData'
|
class: '\Drupal\Core\TypedData\Plugin\DataType\IntegerData'
|
||||||
|
timestamp:
|
||||||
|
label: 'Timestamp'
|
||||||
|
class: '\Drupal\Core\TypedData\Plugin\DataType\Timestamp'
|
||||||
float:
|
float:
|
||||||
label: 'Float'
|
label: 'Float'
|
||||||
class: '\Drupal\Core\TypedData\Plugin\DataType\FloatData'
|
class: '\Drupal\Core\TypedData\Plugin\DataType\FloatData'
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
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
|
|
@ -0,0 +1,17 @@
|
||||||
|
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
|
|
@ -0,0 +1,9 @@
|
||||||
|
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
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue