Skip to content

Commit 4482ee1

Browse files
[BUGFIX] disable usless tests, adjust type hint for PhphStan in TtContentRepository
1 parent 284fbbb commit 4482ee1

6 files changed

Lines changed: 23 additions & 25 deletions

Classes/Domain/Repository/TtContentRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function __construct()
6666
* @todo: move this in a repository
6767
*
6868
* @param string $shortcutItem The single page to be used as the tree root
69-
* @param-out array $collectedItems The collected item data rows ordered by parent position, column position and sorting // array<int, array<non-empty-string, mixed>>
69+
* @param-out array $collectedItems The collected item data rows ordered by parent position, column position and sorting
7070
* @param int $recursive The number of levels for the recursion
7171
* @param int $parentUid uid of the referencing tt_content record
7272
* @param int $language sys_language_uid of the referencing tt_content record

Tests/Functional/ContainerExtensionAvailabilityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function containerExtensionIsLoaded(): void
7575
);
7676
}
7777

78-
self::assertTrue($isLoaded, 'Container extension should be loaded');
78+
// self::assertTrue($isLoaded, 'Container extension should be loaded');
7979
}
8080

8181
#[Test]

Tests/Functional/ContainerExtensionCompatibilityTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public function pasteOperationWorksInContainerElements(): void
272272
self::fail('Container configuration cannot be created: ' . $e->getMessage());
273273
}
274274

275-
self::assertTrue(true, 'Container paste operation test completed');
275+
// self::assertTrue(true, 'Container paste operation test completed');
276276
}
277277

278278
#[Test]
@@ -291,7 +291,7 @@ public function containerParentParameterHandlingAcrossVersions(): void
291291
self::assertTrue(class_exists('B13\\Container\\Tca\\Registry'));
292292
// self::assertTrue(class_exists('B13\\Container\\Tca\\ContainerConfiguration'));
293293

294-
self::assertTrue(true, 'Container parameter handling test completed');
294+
// self::assertTrue(true, 'Container parameter handling test completed');
295295
}
296296

297297
/*

Tests/Functional/ShortcutPreviewRendererCompatibilityTest.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ private function createTestData(): void
6464
[
6565
'uid' => 1,
6666
'pid' => 1,
67-
'tstamp' => 1577836800,
68-
'crdate' => 1577836800,
67+
// 'tstamp' => 1577836800,
68+
// 'crdate' => 1577836800,
6969
'deleted' => 0,
7070
'hidden' => 0,
7171
'CType' => 'text',
@@ -78,8 +78,8 @@ private function createTestData(): void
7878
[
7979
'uid' => 2,
8080
'pid' => 1,
81-
'tstamp' => 1577836800,
82-
'crdate' => 1577836800,
81+
// 'tstamp' => 1577836800,
82+
// 'crdate' => 1577836800,
8383
'deleted' => 0,
8484
'hidden' => 0,
8585
'CType' => 'shortcut',
@@ -147,7 +147,7 @@ public function rendererHandlesVersionSpecificRecordMethods(): void
147147

148148
// Test the actual methods that work
149149
$array = $record->toArray();
150-
self::assertIsArray($array);
150+
// self::assertIsArray($array);
151151
self::assertEquals(1, $array['uid']);
152152

153153
// Test individual methods
@@ -184,7 +184,7 @@ public function getDataRowMethodHandlesVersionDifferences(): void
184184
't3ver_oid' => 0,
185185
't3ver_state' => 0,
186186
't3ver_stage' => 0,
187-
'crdate' => 0,
187+
// 'crdate' => 0,
188188
'header' => 'Test Record',
189189
];
190190

@@ -214,7 +214,7 @@ public function getDataRowMethodHandlesVersionDifferences(): void
214214
't3ver_oid' => 0,
215215
't3ver_state' => 0,
216216
't3ver_stage' => 0,
217-
'crdate' => 0,
217+
// 'crdate' => 0,
218218
'header' => 'Test Record',
219219
];
220220

@@ -261,7 +261,7 @@ public function getContentRecordObjMethodWorksInV14(): void
261261
't3ver_oid' => 0,
262262
't3ver_state' => 0,
263263
't3ver_stage' => 0,
264-
'crdate' => 0,
264+
// 'crdate' => 0,
265265
'header' => 'Test Content',
266266
];
267267

@@ -298,7 +298,7 @@ public function rendererCanHandleGridColumnItemsAcrossVersions(): void
298298
't3ver_oid' => 0,
299299
't3ver_state' => 0,
300300
't3ver_stage' => 0,
301-
'crdate' => 0,
301+
// 'crdate' => 0,
302302
'header' => 'Reference Element',
303303
'records' => '1',
304304
];
@@ -310,7 +310,7 @@ public function rendererCanHandleGridColumnItemsAcrossVersions(): void
310310

311311
// Verify the record has the expected methods
312312
self::assertTrue(method_exists($record, 'getRow'));
313-
self::assertTrue(method_exists($record, 'getUid'));
313+
// self::assertTrue(method_exists($record, 'getUid'));
314314

315315
$row = $record->getRow();
316316
self::assertEquals('shortcut', $row['CType']);
@@ -361,19 +361,19 @@ public function rendererHandlesRecordFactoryAvailability(): void
361361
't3ver_state' => 0,
362362
't3ver_stage' => 0,
363363
't3ver_oid' => 0,
364-
'crdate' => 0,
364+
// 'crdate' => 0,
365365
];
366366

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

369-
self::assertInstanceOf(RecordInterface::class, $record);
369+
// self::assertInstanceOf(RecordInterface::class, $record);
370370

371371
} else {
372372
// In v13 and below, RecordFactory might not exist or behave differently
373373
if (class_exists(RecordFactory::class)) {
374-
self::assertTrue(true, 'RecordFactory exists but behavior may differ in v13');
374+
// self::assertTrue(true, 'RecordFactory exists but behavior may differ in v13');
375375
} else {
376-
self::assertTrue(true, 'RecordFactory not available in TYPO3 v13, which is expected');
376+
// self::assertTrue(true, 'RecordFactory not available in TYPO3 v13, which is expected');
377377
}
378378
}
379379
}
@@ -422,14 +422,14 @@ public function rendererHandlesExtensionConfigurationCorrectly(): void
422422
self::assertIsArray($config);
423423

424424
// Test that the renderer can handle missing configuration gracefully
425-
self::assertTrue(true, 'Renderer should handle extension configuration without errors');
425+
// self::assertTrue(true, 'Renderer should handle extension configuration without errors');
426426
}
427427

428428
#[Test]
429429
public function rendererInheritsFromStandardContentPreviewRenderer(): void
430430
{
431431
// Verify inheritance chain
432-
self::assertInstanceOf(StandardContentPreviewRenderer::class, $this->renderer);
432+
// self::assertInstanceOf(StandardContentPreviewRenderer::class, $this->renderer);
433433

434434
// Test that parent methods are available
435435
$reflection = new \ReflectionClass(StandardContentPreviewRenderer::class);

Tests/Functional/VersionSpecificCompatibilityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public function iconApiIsVersionCompatible(): void
286286

287287
// Test icon identifier usage pattern
288288
$iconIdentifier = 'actions-document-paste-after';
289-
self::assertIsString($iconIdentifier);
289+
// self::assertIsString($iconIdentifier);
290290

291291
// The extension uses standard TYPO3 icon identifiers which should be stable
292292
$standardIcons = [

Tests/Unit/DeprecatedApiDetectionTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function extensionHandlesTypo3VersionDifferences(): void
161161

162162
// Version handling is optional but good practice
163163
if ($hasVersionHandling) {
164-
self::assertTrue($hasVersionHandling, 'Extension has version-specific handling');
164+
// self::assertTrue($hasVersionHandling, 'Extension has version-specific handling');
165165
}
166166
}
167167

@@ -236,9 +236,7 @@ public function shortcutPreviewRendererHandlesVersionSpecificApis(): void
236236

237237
// Check that RecordFactory is used conditionally
238238
$hasRecordFactoryUsage = str_contains($content, 'RecordFactory');
239-
if ($hasRecordFactoryUsage) {
240-
self::assertTrue($hasRecordFactoryUsage, 'RecordFactory usage should be version-aware');
241-
}
239+
self::assertTrue($hasRecordFactoryUsage, 'RecordFactory usage should be version-aware');
242240

243241
// Verify no hardcoded version assumptions
244242
$problematicPatterns = [

0 commit comments

Comments
 (0)