|
@@ 116-133 (lines=18) @@
|
| 113 |
|
$this->assertNotNull($form->Actions()->fieldByName('action_save')); |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
public function testEditImageForm() |
| 117 |
|
{ |
| 118 |
|
$this->logInWithPermission('ADMIN'); |
| 119 |
|
|
| 120 |
|
$image = $this->objFromFixture(Image::class, 'image1'); |
| 121 |
|
$controller = new AssetAdmin(); |
| 122 |
|
$builder = new ImageFormFactory(); |
| 123 |
|
$form = $builder->getForm($controller, 'EditForm', ['Record' => $image]); |
| 124 |
|
|
| 125 |
|
// Check thumbnail |
| 126 |
|
// Note: force_resample is turned off for testing |
| 127 |
|
/** @var LiteralField $iconFullField */ |
| 128 |
|
$iconFullField = $form->Fields()->fieldByName('IconFull'); |
| 129 |
|
$fileThumbnail = $iconFullField->getContent(); |
| 130 |
|
$this->assertContains( |
| 131 |
|
'/FileFormBuilderTest/files/906835357d/testimage.png', |
| 132 |
|
$fileThumbnail |
| 133 |
|
); |
| 134 |
|
} |
| 135 |
|
|
| 136 |
|
public function testInsertImageForm() |
|
@@ 136-148 (lines=13) @@
|
| 133 |
|
); |
| 134 |
|
} |
| 135 |
|
|
| 136 |
|
public function testInsertImageForm() |
| 137 |
|
{ |
| 138 |
|
$this->logInWithPermission('ADMIN'); |
| 139 |
|
|
| 140 |
|
$image = $this->objFromFixture(Image::class, 'image1'); |
| 141 |
|
$controller = new AssetAdmin(); |
| 142 |
|
$builder = new ImageFormFactory(); |
| 143 |
|
$form = $builder->getForm($controller, 'EditForm', ['Record' => $image, 'Type' => 'insert']); |
| 144 |
|
|
| 145 |
|
// Check thumbnail |
| 146 |
|
// Note: force_resample is turned off for testing |
| 147 |
|
$altTextField = $form->Fields()->dataFieldByName('AltText'); |
| 148 |
|
$this->assertNotNull($altTextField); |
| 149 |
|
} |
| 150 |
|
|
| 151 |
|
public function testFolderForm() |