test element pdf path

This commit is contained in:
Yisroel Baum 2026-05-27 20:15:51 +03:00
parent 2c79ab64ad
commit 6c6b3ad257
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
6 changed files with 72 additions and 0 deletions

View file

@ -32,6 +32,7 @@ class GetElementTest extends TestCase
'Baderech HaAvodah',
'A structured path for growth',
'<p>A structured path for growth</p>',
'/assets/pdfs/baderech.pdf',
null,
);
@ -51,6 +52,10 @@ class GetElementTest extends TestCase
'<p>A structured path for growth</p>',
$foundElement->getRichText(),
);
$this->assertSame(
'/assets/pdfs/baderech.pdf',
$foundElement->getPdfPath(),
);
}
public function testReturnsDirectChildElements(): void
@ -61,6 +66,7 @@ class GetElementTest extends TestCase
'Baderech HaAvodah',
'A structured path for growth',
'<p>A structured path for growth</p>',
'/assets/pdfs/baderech.pdf',
null,
);
$firstChildElement = $this->createElement(
@ -68,6 +74,7 @@ class GetElementTest extends TestCase
'Avodah Foundations',
'Foundations for steady avodah',
'<p>Foundations rich text</p>',
'/assets/pdfs/foundations.pdf',
$parentElement,
);
$secondChildElement = $this->createElement(
@ -75,6 +82,7 @@ class GetElementTest extends TestCase
'Daily Practice',
'Daily practices for growth',
'<p>Daily practice rich text</p>',
null,
$parentElement,
);
$this->createElement(
@ -82,6 +90,7 @@ class GetElementTest extends TestCase
'Nested Practice',
'Nested description',
'<p>Nested rich text</p>',
null,
$firstChildElement,
);
$otherSet = $this->createSet(2, 'Daily Learning');
@ -91,12 +100,14 @@ class GetElementTest extends TestCase
'Other parent description',
'<p>Other parent rich text</p>',
null,
null,
);
$this->createElement(
$otherSet,
'Other Child',
'Other child description',
'<p>Other child rich text</p>',
null,
$otherParentElement,
);
@ -157,6 +168,7 @@ class GetElementTest extends TestCase
string $title,
string $description,
string $richText,
?string $pdfPath,
?Element $parentElement,
): Element {
return $this->elementRepo->create(new CreateElementDto(
@ -164,6 +176,7 @@ class GetElementTest extends TestCase
title: $title,
description: $description,
richText: $richText,
pdfPath: $pdfPath,
parentElement: $parentElement,
));
}