17 use Prophecy\Argument;
26 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
44 protected function setUp()
46 $this->timezoneBackup = date_default_timezone_get();
54 date_default_timezone_set($this->timezoneBackup);
68 'date in 2016 in German timezone' => [
69 1457103519,
'Europe/Berlin',
'2016-03-04T15:58:39+00:00'
71 'date in 1969 in German timezone' => [
72 -7200,
'Europe/Berlin',
'1969-12-31T23:00:00+00:00'
75 'date in 2016 in Los Angeles timezone' => [
76 1457103519,
'America/Los_Angeles',
'2016-03-04T06:58:39+00:00'
79 1457103519,
'UTC',
'2016-03-04T14:58:39+00:00'
93 date_default_timezone_set($serverTimezone);
95 'tableName' =>
'table_foo',
96 'fieldName' =>
'field_bar',
100 'parameterArray' => [
101 'tableName' =>
'table_foo',
102 'fieldName' =>
'field_bar',
106 'dbType' =>
'datetime',
107 'eval' =>
'datetime',
108 'default' =>
'0000-00-00 00:00:00'
111 'itemFormElName' =>
'myItemFormElName',
112 'itemFormElValue' => $input
115 $abstractNode = $this->prophesize(AbstractNode::class);
116 $abstractNode->render(Argument::cetera())->willReturn([
117 'additionalJavaScriptPost' => [],
118 'additionalJavaScriptSubmit' => [],
119 'additionalHiddenFields' => [],
120 'stylesheetFiles' => [],
122 $iconFactoryProphecy = $this->prophesize(IconFactory::class);
123 GeneralUtility::addInstance(IconFactory::class, $iconFactoryProphecy->reveal());
124 $iconProphecy = $this->prophesize(Icon::class);
125 $iconProphecy->render()->willReturn(
'');
126 $iconFactoryProphecy->getIcon(Argument::cetera())->willReturn($iconProphecy->reveal());
127 $nodeFactoryProphecy = $this->prophesize(NodeFactory::class);
128 $nodeFactoryProphecy->create(Argument::cetera())->willReturn($abstractNode->reveal());
129 $fieldInformationProphecy = $this->prophesize(FieldInformation::class);
130 $fieldInformationProphecy->render(Argument::cetera())->willReturn([
'html' =>
'']);
131 $nodeFactoryProphecy->create(Argument::cetera())->willReturn($fieldInformationProphecy->reveal());
132 $languageService = $this->prophesize(LanguageService::class);
133 $GLOBALS[
'LANG'] = $languageService->reveal();
135 $result = $subject->render();
136 $this->assertContains(
'<input type="hidden" name="myItemFormElName" value="' . $expectedOutput .
'" />', $result[
'html']);