test element file routing

This commit is contained in:
Yisroel Baum 2026-06-14 23:05:45 +03:00
parent 14d2ce2284
commit 0d5783ba9c
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
14 changed files with 951 additions and 388 deletions

View file

@ -22,7 +22,8 @@ class ElementTest extends TestCase
description: 'Root description',
iconImageUrl: null,
richText: '<p>Root rich text</p>',
pdfPath: null,
shortPdfPath: null,
longPdfPath: null,
youtubeUrl: null,
set: $set,
parentElement: null,
@ -33,7 +34,8 @@ class ElementTest extends TestCase
description: 'Child description',
iconImageUrl: '/assets/child-icon.svg',
richText: '<p>Child rich text</p>',
pdfPath: '/assets/pdfs/child.pdf',
shortPdfPath: '/assets/pdfs/child.pdf',
longPdfPath: '/assets/pdfs/child-long.pdf',
youtubeUrl: 'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
set: $set,
parentElement: $rootElement,
@ -55,7 +57,11 @@ class ElementTest extends TestCase
);
$this->assertSame(
'/assets/pdfs/child.pdf',
$childElement->getPdfPath(),
$childElement->getShortPdfPath(),
);
$this->assertSame(
'/assets/pdfs/child-long.pdf',
$childElement->getLongPdfPath(),
);
$this->assertSame(
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
@ -64,7 +70,8 @@ class ElementTest extends TestCase
$this->assertSame($set, $childElement->getSet());
$this->assertSame($rootElement, $childElement->getParentElement());
$this->assertNull($rootElement->getIconImageUrl());
$this->assertNull($rootElement->getPdfPath());
$this->assertNull($rootElement->getShortPdfPath());
$this->assertNull($rootElement->getLongPdfPath());
$this->assertNull($rootElement->getYoutubeUrl());
$this->assertNull($rootElement->getParentElement());
}
@ -83,7 +90,8 @@ class ElementTest extends TestCase
description: 'Original description',
iconImageUrl: '/assets/original.svg',
richText: '<p>Original</p>',
pdfPath: '/assets/pdfs/original.pdf',
shortPdfPath: '/assets/pdfs/original.pdf',
longPdfPath: '/assets/pdfs/original-long.pdf',
youtubeUrl: 'https://www.youtube.com/watch?v=yHx-r4p6hHU',
set: $set,
parentElement: null,
@ -93,14 +101,16 @@ class ElementTest extends TestCase
$element->setDescription('Updated description');
$element->setIconImageUrl(null);
$element->setRichText('<p>Updated</p>');
$element->setPdfPath(null);
$element->setShortPdfPath(null);
$element->setLongPdfPath(null);
$element->setYoutubeUrl(null);
$this->assertSame('Updated', $element->getTitle());
$this->assertSame('Updated description', $element->getDescription());
$this->assertNull($element->getIconImageUrl());
$this->assertSame('<p>Updated</p>', $element->getRichText());
$this->assertNull($element->getPdfPath());
$this->assertNull($element->getShortPdfPath());
$this->assertNull($element->getLongPdfPath());
$this->assertNull($element->getYoutubeUrl());
}
}