public function MigrateContactCategoryTest::testContactCategory in Zircon Profile 8
Same name in this branch
- 8 core/modules/contact/src/Tests/Migrate/MigrateContactCategoryTest.php \Drupal\contact\Tests\Migrate\MigrateContactCategoryTest::testContactCategory()
- 8 core/modules/contact/src/Tests/Migrate/d6/MigrateContactCategoryTest.php \Drupal\contact\Tests\Migrate\d6\MigrateContactCategoryTest::testContactCategory()
Same name and namespace in other branches
- 8.0 core/modules/contact/src/Tests/Migrate/d6/MigrateContactCategoryTest.php \Drupal\contact\Tests\Migrate\d6\MigrateContactCategoryTest::testContactCategory()
The Drupal 6 contact categories to Drupal 8 migration.
File
- core/
modules/ contact/ src/ Tests/ Migrate/ d6/ MigrateContactCategoryTest.php, line 36 - Contains \Drupal\contact\Tests\Migrate\d6\MigrateContactCategoryTest.
Class
- MigrateContactCategoryTest
- Migrate contact categories to contact.form.*.yml.
Namespace
Drupal\contact\Tests\Migrate\d6Code
public function testContactCategory() {
/** @var \Drupal\contact\Entity\ContactForm $contact_form */
$contact_form = ContactForm::load('website_feedback');
$this
->assertIdentical('Website feedback', $contact_form
->label());
$this
->assertIdentical(array(
'admin@example.com',
), $contact_form
->getRecipients());
$this
->assertIdentical('', $contact_form
->getReply());
$this
->assertIdentical(0, $contact_form
->getWeight());
$contact_form = ContactForm::load('some_other_category');
$this
->assertIdentical('Some other category', $contact_form
->label());
$this
->assertIdentical(array(
'test@example.com',
), $contact_form
->getRecipients());
$this
->assertIdentical('Thanks for contacting us, we will reply ASAP!', $contact_form
->getReply());
$this
->assertIdentical(1, $contact_form
->getWeight());
$contact_form = ContactForm::load('a_category_much_longer_than_thir');
$this
->assertIdentical('A category much longer than thirty two characters', $contact_form
->label());
$this
->assertIdentical(array(
'fortyninechars@example.com',
), $contact_form
->getRecipients());
$this
->assertIdentical('', $contact_form
->getReply());
$this
->assertIdentical(2, $contact_form
->getWeight());
}