class DateTimeIso8601NormalizerTestDrupalDateTime
Same name in other branches
- 9 core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\DateTimeIso8601NormalizerTestDrupalDateTime
- 8.9.x core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\DateTimeIso8601NormalizerTestDrupalDateTime
- 11.x core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\DateTimeIso8601NormalizerTestDrupalDateTime
Provides a test class for testing DrupalDateTime.
Note: Prophecy does not support magic methods. By subclassing and specifying an explicit method, Prophecy works.
Hierarchy
- class \Drupal\Component\Datetime\DateTimePlus uses \Drupal\Component\Utility\ToStringTrait
- class \Drupal\Core\Datetime\DrupalDateTime extends \Drupal\Component\Datetime\DateTimePlus uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\Tests\serialization\Unit\Normalizer\DateTimeIso8601NormalizerTestDrupalDateTime extends \Drupal\Core\Datetime\DrupalDateTime
- class \Drupal\Core\Datetime\DrupalDateTime extends \Drupal\Component\Datetime\DateTimePlus uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
Expanded class hierarchy of DateTimeIso8601NormalizerTestDrupalDateTime
See also
https://github.com/phpspec/prophecy/issues/338
https://github.com/phpspec/prophecy/issues/34
https://github.com/phpspec/prophecy/issues/80
File
-
core/
modules/ serialization/ tests/ src/ Unit/ Normalizer/ DateTimeIso8601NormalizerTest.php, line 269
Namespace
Drupal\Tests\serialization\Unit\NormalizerView source
class DateTimeIso8601NormalizerTestDrupalDateTime extends DrupalDateTime {
public function setTimezone(\DateTimeZone $timezone) {
parent::setTimezone($timezone);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Member alias | Overriden Title | Overrides |
---|---|---|---|---|---|---|
DateTimeIso8601NormalizerTestDrupalDateTime::setTimezone | public | function | ||||
DateTimePlus::$dateParts | protected static | property | An array of possible date parts. | |||
DateTimePlus::$dateTimeObject | protected | property | The DateTime object. | |||
DateTimePlus::$errors | protected | property | An array of errors encountered when creating this date. | |||
DateTimePlus::$inputFormatAdjusted | protected | property | The prepared format, if provided. | |||
DateTimePlus::$inputFormatRaw | protected | property | The value of the format passed to the constructor. | |||
DateTimePlus::$inputTimeAdjusted | protected | property | The prepared time, without timezone, for this date. | |||
DateTimePlus::$inputTimeRaw | protected | property | The value of the time value passed to the constructor. | |||
DateTimePlus::$inputTimeZoneAdjusted | protected | property | The prepared timezone object used to construct this date. | |||
DateTimePlus::$inputTimeZoneRaw | protected | property | The value of the timezone passed to the constructor. | |||
DateTimePlus::$langcode | protected | property | The value of the language code passed to the constructor. | |||
DateTimePlus::arrayToISO | public static | function | Creates an ISO date from an array of values. | |||
DateTimePlus::checkArray | public static | function | Checks that arrays of date parts will create a valid date. | |||
DateTimePlus::checkErrors | public | function | Examines getLastErrors() to see what errors to report. | |||
DateTimePlus::createFromArray | public static | function | Creates a date object from an array of date parts. | |||
DateTimePlus::createFromDateTime | public static | function | Creates a date object from an input date object. | |||
DateTimePlus::createFromFormat | public static | function | Creates a date object from an input format. | |||
DateTimePlus::createFromTimestamp | public static | function | Creates a date object from timestamp input. | |||
DateTimePlus::datePad | public static | function | Pads date parts with zeros. | |||
DateTimePlus::diff | public | function | Returns the difference between two DateTimePlus objects. | |||
DateTimePlus::FORMAT | constant | 1 | ||||
DateTimePlus::getErrors | public | function | Gets error messages. | |||
DateTimePlus::getPhpDateTime | public | function | Gets a clone of the proxied PHP \DateTime object wrapped by this class. | |||
DateTimePlus::hasErrors | public | function | Detects if there were errors in the processing of this date. | |||
DateTimePlus::prepareArray | public static | function | Creates a complete array from a possibly incomplete array of date parts. | |||
DateTimePlus::prepareFormat | protected | function | Prepares the input format value. | |||
DateTimePlus::prepareTime | protected | function | Prepares the input time value. | |||
DateTimePlus::render | public | function | Renders the timezone name. | Overrides ToStringTrait::render | ||
DateTimePlus::RFC7231 | constant | A RFC7231 Compliant date. | ||||
DateTimePlus::setDefaultDateTime | public | function | Sets the default time for an object built from date-only data. | |||
DateTimePlus::__call | public | function | Implements the magic __call method. | |||
DateTimePlus::__callStatic | public static | function | Implements the magic __callStatic method. | |||
DateTimePlus::__clone | public | function | Implements the magic __clone method. | |||
DependencySerializationTrait::$_entityStorages | protected | property | ||||
DependencySerializationTrait::$_serviceIds | protected | property | ||||
DependencySerializationTrait::__sleep | public | function | Aliased as: defaultSleep | 1 | ||
DependencySerializationTrait::__wakeup | public | function | 2 | |||
DrupalDateTime::$formatTranslationCache | protected | property | Formatted strings translation cache. | |||
DrupalDateTime::format | public | function | Overrides format(). | Overrides DateTimePlus::format | ||
DrupalDateTime::prepareTimezone | protected | function | Overrides prepareTimezone(). | Overrides DateTimePlus::prepareTimezone | ||
DrupalDateTime::__construct | public | function | Constructs a date object. | Overrides DateTimePlus::__construct | ||
DrupalDateTime::__sleep | public | function | ||||
StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | 3 | ||
StringTranslationTrait::formatPlural | protected | function | Formats a string containing a count of items. | |||
StringTranslationTrait::getNumberOfPlurals | protected | function | Returns the number of plurals supported by a given language. | |||
StringTranslationTrait::getStringTranslation | protected | function | Gets the string translation service. | |||
StringTranslationTrait::setStringTranslation | public | function | Sets the string translation service to use. | 2 | ||
StringTranslationTrait::t | protected | function | Translates a string to the current language or to a given language. | |||
ToStringTrait::_die | protected | function | For test purposes, wrap die() in an overridable method. | |||
ToStringTrait::__toString | public | function | Implements the magic __toString() method. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.