Source of file PageSectionBlockTest.php
Size: 1,171 Bytes - Last Modified: 2021-12-24T06:45:33+00:00
/var/www/docs.ssmods.com/process/src/tests/PageSectionBlockTest.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 | <?php namespace Dynamic\DynamicBlocks\Test; use Dynamic\DynamicBlocks\Block\PageSectionBlock; use SilverStripe\Dev\SapphireTest; use SilverStripe\Forms\FieldList; /** * Class PageSectionBlockTest */ class PageSectionBlockTest extends SapphireTest { /** * @var string */ protected static $fixture_file = 'dynamic-blocks/tests/Fixtures.yml'; /** * */ public function testGetPluralName() { $object = singleton(PageSectionBlock::class); $this->assertEquals('Page Sections Blocks', $object->plural_name()); } /** * */ public function testGetCMSFields() { $object = $this->objFromFixture(PageSectionBlock::class, 'one'); $fields = $object->getCMSFields(); $this->assertInstanceOf(FieldList::class, $fields); $this->assertNotNull($fields->dataFieldByName('Sections')); } /** * */ public function testGetPageSections() { $object = $this->objFromFixture(PageSectionBlock::class, 'one'); $expected = $object->Sections()->sort('SortOrder'); $this->assertEquals($expected, $object->getPageSections()); } } |