WIP|Shorten slugs

Slugs might sometimes become too long.
This should be handled, but we do not know how right now.
This is already a test setup for validating the logic.

Relates: #11496
This commit is contained in:
Daniel Siepmann (Codappix) 2024-11-11 07:28:52 +01:00
parent 8eb784cbb3
commit cb5a38da93
SSH key fingerprint: SHA256:nAjx3Dpp8kuAC+S7QXj8BWmqw+KI1Miu+5e40BP3LXA
3 changed files with 92 additions and 0 deletions

View file

@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
return [
'tx_events_domain_model_event' => [
[
'uid' => 1,
'global_id' => 'e_100347854',
'slug' => 'kann-man-noch-guten-gewissens-kinder',
],
],
'tx_events_domain_model_date' => [
[
'uid' => 1,
'event' => '1',
'slug' => 'kann-man-noch-guten-gewissens-kinder-2099-12-19t14-00-00',
],
],
];

View file

@ -0,0 +1,58 @@
{
"status": "OK",
"count": 1,
"overallcount": 1,
"channels": [],
"facetGroups": [],
"items": [
{
"global_id": "e_100347854",
"id": "100347854",
"title": "Kann man noch guten Gewissens Kinder bekommen? Ein Arzt hat sich von seiner Frau getrennt, weil diese ein Kind mit ihm haben wollte seiner Meinung nach unverantwortlich in einer Welt, die durch den weit fortgeschrittenen Klimawandel dem Untergang ge …",
"type": "Event",
"categories": [
],
"texts": [
],
"country": "Deutschland",
"areas": [
"Rudolstadt und Umgebung"
],
"city": "Rudolstadt",
"zip": "07407",
"street": "Schillerstraße 25",
"phone": "+ 49 3672 / 486470",
"fax": "+ 49 3672 / 486475",
"web": "http://www.schillerhaus.rudolstadt.de/",
"email": "schillerhaus@rudolstadt.de",
"author": "support@hubermedia.de",
"media_objects": [
],
"keywords": [
],
"timeIntervals": [
{
"weekdays": [],
"start": "2099-12-19T15:00:00+01:00",
"end": "2099-12-19T16:30:00+01:00",
"tz": "Europe/Berlin",
"interval": 1
}
],
"name": "Schillerhaus Rudolstadt",
"features": [
],
"addresses": [
],
"created": "2099-10-31T12:29:00+00:00",
"changed": "2099-12-14T08:29:00+00:00",
"company": "",
"district": "",
"postoffice": "",
"phone2": "",
"seasons": [],
"subitems": [],
"hyperObjects": []
}
]
}

View file

@ -94,4 +94,18 @@ class ImportsExampleAsExpectedTest extends AbstractTestCase
$this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsKeywords.php'); $this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsKeywords.php');
$this->assertEmptyLog(); $this->assertEmptyLog();
} }
#[Test]
public function importsWithTooLongSlug(): void
{
$this->importPHPDataSet(__DIR__ . '/Fixtures/Database/DefaultImportConfiguration.php');
$this->setUpResponses([
new Response(200, [], file_get_contents(__DIR__ . '/Fixtures/ResponseWithTooLongSlug.json') ?: ''),
]);
$this->executeCommand();
$this->assertPHPDataSet(__DIR__ . '/Assertions/ImportsWithTooLongSlug.php');
$this->assertEmptyLog();
}
} }