O'Reilly logo

Drupal 8 Module Development by Daniel Sipos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hello World form test

The second Functional test we will write should test the salutation override form itself. In the previous one, we interacted with the configuration API directly to make changes to the configuration value. Now we will see if the form to do so actually works. But since we can reuse quite a lot from the previous test, and they are very closely related, we can add it to the same class:

/** * Tests that the configuration form for overriding the message works. */ public function testForm() { $expected = $this->assertDefaultSalutation(); $this->drupalGet('/admin/config/salutation-configuration'); $this->assertSession()->statusCodeEquals(403); $account = $this->drupalCreateUser(['administer site configuration']); $this->drupalLogin($account); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required