| @@ 3-23 (lines=21) @@ | ||
| 1 | <?php |
|
| 2 | ||
| 3 | class BlocksSlideImageDataExtensionTest extends DataExtension |
|
| 4 | { |
|
| 5 | /** |
|
| 6 | * @var string |
|
| 7 | */ |
|
| 8 | protected static $fixture_file = 'dynamic-blocks/tests/Fixtures.yml'; |
|
| 9 | ||
| 10 | /** |
|
| 11 | * |
|
| 12 | */ |
|
| 13 | public function testGetCMSFields() |
|
| 14 | { |
|
| 15 | $object = $this->objFromFixture('SlideImage', 'one'); |
|
| 16 | $fields = $object->getCMSFields(); |
|
| 17 | $extension = new ContentBlockDataExtension(); |
|
| 18 | $extension->updateCMSFields($fields); |
|
| 19 | ||
| 20 | $this->assertInstanceOf('FieldList', $fields); |
|
| 21 | $this->assertNotNull($fields->dataFieldByName('SlideshowBlock')); |
|
| 22 | } |
|
| 23 | } |
|
| @@ 3-23 (lines=21) @@ | ||
| 1 | <?php |
|
| 2 | ||
| 3 | class DynamicContentBlockDataExtensionTest extends SapphireTest |
|
| 4 | { |
|
| 5 | /** |
|
| 6 | * @var string |
|
| 7 | */ |
|
| 8 | protected static $fixture_file = 'dynamic-blocks/tests/Fixtures.yml'; |
|
| 9 | ||
| 10 | /** |
|
| 11 | * |
|
| 12 | */ |
|
| 13 | public function testGetCMSFields() |
|
| 14 | { |
|
| 15 | $object = $this->objFromFixture('ContentBlock', 'one'); |
|
| 16 | $fields = $object->getCMSFields(); |
|
| 17 | $extension = new DynamicContentBlockDataExtension(); |
|
| 18 | $extension->updateCMSFields($fields); |
|
| 19 | ||
| 20 | $this->assertInstanceOf('FieldList', $fields); |
|
| 21 | $this->assertNotNull($fields->dataFieldByName('Image')); |
|
| 22 | } |
|
| 23 | } |
|