public function UCXFTestCase::setupFields in Extra Fields Checkout Pane 6.2
Same name and namespace in other branches
- 7 uc_extra_fields_pane.test \UCXFTestCase::setupFields()
Create default fields
Return value
void
3 calls to UCXFTestCase::setupFields()
- UCXFApiTestCase::testUCXF_Value in ./
uc_extra_fields_pane.test - Test if UCXF_Value behaves as excepted.
- UCXFCheckoutTestCase::testCheckout in ./
uc_extra_fields_pane.test - Test if checkout works as expected.
- UCXFOrderTestCase::testOrder in ./
uc_extra_fields_pane.test - Test the order administration.
File
- ./
uc_extra_fields_pane.test, line 97 - Automated tests for Extra Fields Pane
Class
- UCXFTestCase
- Base class for all Extra Fields Pane test cases.
Code
public function setupFields() {
// Login as admin
$this
->drupalLogin($this->adminUser);
// Create address fields
$this->textField = $this
->createAddressField(UCXF_Field::UCXF_WIDGET_TYPE_TEXTFIELD);
$this->selectField = $this
->createAddressField(UCXF_Field::UCXF_WIDGET_TYPE_SELECT);
$this
->assertNoText(t('In this example the key of the first item is just a single space.'), t('The select field was saved without problems.'));
$this->constantField = $this
->createAddressField(UCXF_Field::UCXF_WIDGET_TYPE_CONSTANT);
$this->checkboxField = $this
->createAddressField(UCXF_Field::UCXF_WIDGET_TYPE_CHECKBOX);
$this->phpField = $this
->createAddressField(UCXF_Field::UCXF_WIDGET_TYPE_PHP);
$this->phpSelectField = $this
->createAddressField(UCXF_Field::UCXF_WIDGET_TYPE_PHP_SELECT);
$this
->assertNoText(t('In this example the key of the first item is an empty string.'), t('The php select field was saved without problems.'));
// A "hidden" constant field.
$this->hiddenConstantField = $this
->createAddressField(UCXF_Field::UCXF_WIDGET_TYPE_CONSTANT, array(
'ucxf[display_settings][checkout]' => FALSE,
'ucxf[value]' => 'hidden constant',
));
// Create custom order fields
// A text field with a default value.
$this->infoTextField = $this
->createCustomOrderField(UCXF_Field::UCXF_WIDGET_TYPE_TEXTFIELD, array(
'ucxf[value]' => 'default text',
));
// A "hidden" PHP field.
$this->hiddenPhpField = $this
->createCustomOrderField(UCXF_Field::UCXF_WIDGET_TYPE_PHP, array(
'ucxf[display_settings][checkout]' => FALSE,
'ucxf[value]' => '<?php return "hidden string"; ?>',
));
}