|
@@ 606-629 (lines=24) @@
|
| 603 |
|
$this->assertContains('File5',$field->getItems()->column('Title')); |
| 604 |
|
} |
| 605 |
|
|
| 606 |
|
public function testReadonly() { |
| 607 |
|
$this->loginWithPermission('ADMIN'); |
| 608 |
|
|
| 609 |
|
$response = $this->get('UploadFieldTest_Controller'); |
| 610 |
|
$this->assertFalse($response->isError()); |
| 611 |
|
|
| 612 |
|
$parser = new CSSContentParser($response->getBody()); |
| 613 |
|
|
| 614 |
|
$this->assertFalse( |
| 615 |
|
(bool)$parser->getBySelector( |
| 616 |
|
'#UploadFieldTestForm_Form_ReadonlyField .ss-uploadfield-files .ss-uploadfield-item .ss-ui-button' |
| 617 |
|
), |
| 618 |
|
'Removes all buttons on items'); |
| 619 |
|
$this->assertFalse( |
| 620 |
|
(bool)$parser->getBySelector('#UploadFieldTestForm_Form_ReadonlyField .ss-uploadfield-dropzone'), |
| 621 |
|
'Removes dropzone' |
| 622 |
|
); |
| 623 |
|
$this->assertFalse( |
| 624 |
|
(bool)$parser->getBySelector( |
| 625 |
|
'#UploadFieldTestForm_Form_ReadonlyField .ss-uploadfield-addfile' |
| 626 |
|
), |
| 627 |
|
'Entire "add" area' |
| 628 |
|
); |
| 629 |
|
} |
| 630 |
|
|
| 631 |
|
public function testDisabled() { |
| 632 |
|
$this->loginWithPermission('ADMIN'); |
|
@@ 631-651 (lines=21) @@
|
| 628 |
|
); |
| 629 |
|
} |
| 630 |
|
|
| 631 |
|
public function testDisabled() { |
| 632 |
|
$this->loginWithPermission('ADMIN'); |
| 633 |
|
|
| 634 |
|
$response = $this->get('UploadFieldTest_Controller'); |
| 635 |
|
$this->assertFalse($response->isError()); |
| 636 |
|
|
| 637 |
|
$parser = new CSSContentParser($response->getBody()); |
| 638 |
|
$this->assertFalse( |
| 639 |
|
(bool)$parser->getBySelector( |
| 640 |
|
'#UploadFieldTestForm_Form_DisabledField .ss-uploadfield-files .ss-uploadfield-item .ss-ui-button' |
| 641 |
|
), |
| 642 |
|
'Removes all buttons on items'); |
| 643 |
|
$this->assertFalse((bool)$parser->getBySelector( |
| 644 |
|
'#UploadFieldTestForm_Form_DisabledField .ss-uploadfield-dropzone' |
| 645 |
|
), |
| 646 |
|
'Removes dropzone'); |
| 647 |
|
$this->assertFalse( |
| 648 |
|
(bool)$parser->getBySelector('#UploadFieldTestForm_Form_DisabledField .ss-uploadfield-addfile'), |
| 649 |
|
'Entire "add" area' |
| 650 |
|
); |
| 651 |
|
} |
| 652 |
|
|
| 653 |
|
public function testCanUpload() { |
| 654 |
|
$this->loginWithPermission('ADMIN'); |