Skip to content

Commit 307aa42

Browse files
[Task] fix some functional tests
1 parent de52445 commit 307aa42

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

Tests/Functional/ApiCompatibilityTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,15 @@ public function globalVariablesAreAccessibleAcrossVersions(): void
202202
$request = $GLOBALS['TYPO3_REQUEST'] ?? null;
203203

204204
// The extension should handle null request gracefully
205-
self::assertTrue(is_object($request), 'Global variables access pattern is compatible');
205+
self::assertTrue(!is_empty($request), 'Global variables access pattern is compatible');
206206

207207
// Test BE_USER global access pattern
208208
$backendUser = $GLOBALS['BE_USER'] ?? null;
209-
self::assertTrue($backendUser, 'Backend user global access pattern is compatible');
209+
self::assertTrue(is_object($backendUser), 'Backend user global access pattern is compatible');
210210

211211
// Test LANG global access pattern
212212
$languageService = $GLOBALS['LANG'] ?? null;
213-
self::assertTrue($languageService, 'Language service global access pattern is compatible');
213+
self::assertTrue(is_object($languageService), 'Language service global access pattern is compatible');
214214
}
215215

216216
#[Test]
@@ -285,6 +285,7 @@ public function shortcutPreviewRendererApiIsCompatible(): void
285285
'sys_language_uid' => 0,
286286
'l18n_parent' => 0,
287287
't3ver_wsid' => 0,
288+
't3ver_oid' => 0,
288289
];
289290
$record = $recordFactory->createFromDatabaseRow('tt_content', $testData);
290291

Tests/Functional/ShortcutPreviewRendererCompatibilityTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ public function rendererHandlesVersionSpecificRecordMethods(): void
127127
'CType' => 'shortcut',
128128
'sys_language_uid' => 0,
129129
'l18n_parent' => 0,
130+
't3ver_wsid' => 0,
131+
't3ver_oid' => 0,
130132
'header' => 'Test Shortcut',
131133
'records' => '2',
132134
];
@@ -174,6 +176,8 @@ public function getDataRowMethodHandlesVersionDifferences(): void
174176
'CType' => 'shortcut',
175177
'sys_language_uid' => 0,
176178
'l18n_parent' => 0,
179+
't3ver_wsid' => 0,
180+
't3ver_oid' => 0,
177181
'header' => 'Test Record',
178182
];
179183

@@ -199,6 +203,8 @@ public function getDataRowMethodHandlesVersionDifferences(): void
199203
'CType' => 'shortcut',
200204
'sys_language_uid' => 0,
201205
'l18n_parent' => 0,
206+
't3ver_wsid' => 0,
207+
't3ver_oid' => 0,
202208
'header' => 'Test Record',
203209
];
204210

@@ -242,6 +248,7 @@ public function getContentRecordObjMethodWorksInV14(): void
242248
'sys_language_uid' => 0,
243249
'l18n_parent' => 0,
244250
't3ver_wsid' => 0,
251+
't3ver_oid' => 0,
245252
'header' => 'Test Content',
246253
];
247254

@@ -275,6 +282,7 @@ public function rendererCanHandleGridColumnItemsAcrossVersions(): void
275282
'sys_language_uid' => 0,
276283
'l18n_parent' => 0,
277284
't3ver_wsid' => 0,
285+
't3ver_oid' => 0,
278286
'header' => 'Reference Element',
279287
'records' => '1',
280288
];
@@ -334,6 +342,7 @@ public function rendererHandlesRecordFactoryAvailability(): void
334342
'sys_language_uid' => 0,
335343
'l18n_parent' => 0,
336344
't3ver_wsid' => 0,
345+
't3ver_oid' => 0,
337346
];
338347

339348
$record = $recordFactory->createFromDatabaseRow('tt_content', $testData);

Tests/Functional/VersionSpecificCompatibilityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private function createTestData(): void
125125
#[Test]
126126
public function contextMenuItemProviderWorksInCurrentVersion(): void
127127
{
128-
$provider = GeneralUtility::makeInstance(PasteReferenceItemProvider::class);
128+
$provider = new PasteReferenceItemProvider();
129129

130130
// Test that the provider extends the correct base class
131131
self::assertInstanceOf(RecordProvider::class, $provider);

0 commit comments

Comments
 (0)