test element file routing
This commit is contained in:
parent
14d2ce2284
commit
0d5783ba9c
14 changed files with 951 additions and 388 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue