2 declare(strict_types = 1);
38 protected function setUp(): void
43 $this->backendUser->workspace = 0;
51 $GLOBALS[
'TCA'][
'pages'][
'columns'][
'keywords'][
'config'][
'default'] =
'a few,random,keywords';
52 $map = $this->actionService->createNewRecord(
'pages', self::PAGE_DATAHANDLER, [
53 'title' =>
'A new age'
55 $newPageId = reset($map[
'pages']);
57 self::assertEquals($newPageRecord[
'keywords'],
$GLOBALS[
'TCA'][
'pages'][
'columns'][
'keywords'][
'config'][
'default']);
59 $GLOBALS[
'TCA'][
'tt_content'][
'columns'][
'header'][
'config'][
'default'] =
'Pre-set header';
60 $map = $this->actionService->createNewRecord(
'tt_content', $newPageId, [
62 'bodytext' =>
'Random bodytext'
64 $newContentId = reset($map[
'tt_content']);
67 self::assertEquals($newContentRecord[
'header'],
'');
69 $map = $this->actionService->createNewRecord(
'tt_content', $newPageId, [
70 'bodytext' =>
'Random bodytext'
72 $newContentId = reset($map[
'tt_content']);
74 self::assertEquals($newContentRecord[
'header'],
$GLOBALS[
'TCA'][
'tt_content'][
'columns'][
'header'][
'config'][
'default']);
83 TCAdefaults.pages.keywords = from pagets, with love
84 TCAdefaults.tt_content.header = global space');
85 $map = $this->actionService->createNewRecord(
'pages', self::PAGE_DATAHANDLER, [
86 'title' =>
'A new age'
88 $newPageId = reset($map[
'pages']);
90 self::assertEquals($newPageRecord[
'keywords'],
'from pagets, with love');
92 $map = $this->actionService->createNewRecord(
'tt_content', $newPageId, [
94 'bodytext' =>
'Random bodytext'
96 $newContentId = reset($map[
'tt_content']);
99 self::assertEquals($newContentRecord[
'header'],
'');
101 $map = $this->actionService->createNewRecord(
'tt_content', $newPageId, [
102 'bodytext' =>
'Random bodytext'
104 $newContentId = reset($map[
'tt_content']);
106 self::assertEquals($newContentRecord[
'header'],
'global space');
115 TCAdefaults.pages.keywords = from pagets, with love
116 TCAdefaults.tt_content.header = global space');
117 $this->actionService->modifyRecord(
'pages', self::PAGE_DATAHANDLER, [
120 TCAdefaults.pages.keywords = I am specific, not generic
121 TCAdefaults.tt_content.header = local space
124 $map = $this->actionService->createNewRecord(
'pages', self::PAGE_DATAHANDLER, [
125 'title' =>
'A new age'
127 $newPageId = reset($map[
'pages']);
129 self::assertEquals($newPageRecord[
'keywords'],
'I am specific, not generic');
131 $map = $this->actionService->createNewRecord(
'tt_content', $newPageId, [
133 'bodytext' =>
'Random bodytext'
135 $newContentId = reset($map[
'tt_content']);
138 self::assertEquals($newContentRecord[
'header'],
'');
140 $map = $this->actionService->createNewRecord(
'tt_content', $newPageId, [
141 'bodytext' =>
'Random bodytext'
143 $newContentId = reset($map[
'tt_content']);
145 self::assertEquals($newContentRecord[
'header'],
'local space');