TYPO3 CMS  TYPO3_6-2
AbstractActionTestCase.php
Go to the documentation of this file.
1 <?php
3 
17 require_once dirname(dirname(__FILE__)) . '/AbstractDataHandlerActionTestCase.php';
18 
23 
24  const VALUE_PageId = 89;
25  const VALUE_PageIdTarget = 90;
26  const VALUE_ContentIdFirst = 297;
27  const VALUE_ContentIdLast = 298;
28  const VALUE_LanguageId = 1;
31 
32  const TABLE_Page = 'pages';
33  const TABLE_Content = 'tt_content';
34  const TABLE_Category = 'sys_category';
35  const TABLE_ContentCategory_ManyToMany = 'sys_category_record_mm';
36 
40  protected $scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/DataSet/';
41 
42  public function setUp() {
43  parent::setUp();
44  $this->importScenarioDataSet('LiveDefaultPages');
45  $this->importScenarioDataSet('LiveDefaultElements');
46 
47  $this->setUpFrontendRootPage(1, array('typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts'));
48  $this->backendUser->workspace = 0;
49  }
50 
59  public function addCategoryRelation() {
60  $this->actionService->modifyReferences(
61  self::TABLE_Content, self::VALUE_ContentIdFirst, 'categories', array(self::VALUE_CategoryIdFirst, self::VALUE_CategoryIdSecond, 31)
62  );
63  }
64 
69  public function deleteCategoryRelation() {
70  $this->actionService->modifyReferences(
71  self::TABLE_Content, self::VALUE_ContentIdFirst, 'categories', array(self::VALUE_CategoryIdFirst)
72  );
73  }
74 
79  public function changeCategoryRelationSorting() {
80  $this->actionService->modifyReferences(
81  self::TABLE_Content, self::VALUE_ContentIdFirst, 'categories', array(self::VALUE_CategoryIdSecond, self::VALUE_CategoryIdFirst)
82  );
83  }
84 
89  public function modifyCategoryOfRelation() {
90  $this->actionService->modifyRecord(self::TABLE_Category, self::VALUE_CategoryIdFirst, array('title' => 'Testing #1'));
91  }
92 
97  public function modifyContentOfRelation() {
98  $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, array('header' => 'Testing #1'));
99  }
100 
105  public function modifyBothsOfRelation() {
106  $this->actionService->modifyRecord(self::TABLE_Category, self::VALUE_CategoryIdFirst, array('title' => 'Testing #1'));
107  $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, array('header' => 'Testing #1'));
108  }
109 
114  public function deleteContentOfRelation() {
115  $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
116  }
117 
122  public function deleteCategoryOfRelation() {
123  $this->actionService->deleteRecord(self::TABLE_Category, self::VALUE_CategoryIdFirst);
124  }
125 
130  public function copyContentOfRelation() {
131  $newTableIds = $this->actionService->copyRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageId);
132  $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
133  }
134 
139  public function copyCategoryOfRelation() {
140  $this->actionService->copyRecord(self::TABLE_Category, self::VALUE_CategoryIdFirst, 0);
141  }
142 
147  public function localizeContentOfRelation() {
148  $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
149  }
150 
155  public function localizeCategoryOfRelation() {
156  $this->actionService->localizeRecord(self::TABLE_Category, self::VALUE_CategoryIdFirst, self::VALUE_LanguageId);
157  }
158 
164  $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
165  }
166 
171  public function copyPage() {
172  $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget);
173  $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId];
174  $this->recordIds['newContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdFirst];
175  $this->recordIds['newContentIdLast'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
176  }
177 
178 }
setUpFrontendRootPage($pageId, array $typoScriptFiles=array())