public function FormTest::testGetUriActionAbsolute in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/dom-crawler/Tests/FormTest.php \Symfony\Component\DomCrawler\Tests\FormTest::testGetUriActionAbsolute()
File
- vendor/
symfony/ dom-crawler/ Tests/ FormTest.php, line 500
Class
Namespace
Symfony\Component\DomCrawler\TestsCode
public function testGetUriActionAbsolute() {
$formHtml = '<form id="login_form" action="https://login.foo.com/login.php?login_attempt=1" method="POST"><input type="text" name="foo" value="foo" /><input type="submit" /></form>';
$form = $this
->createForm($formHtml);
$this
->assertEquals('https://login.foo.com/login.php?login_attempt=1', $form
->getUri(), '->getUri() returns absolute URIs set in the action form');
$form = $this
->createForm($formHtml, null, 'https://login.foo.com');
$this
->assertEquals('https://login.foo.com/login.php?login_attempt=1', $form
->getUri(), '->getUri() returns absolute URIs set in the action form');
$form = $this
->createForm($formHtml, null, 'https://login.foo.com/bar/');
$this
->assertEquals('https://login.foo.com/login.php?login_attempt=1', $form
->getUri(), '->getUri() returns absolute URIs set in the action form');
// The action URI haven't the same domain Host have an another domain as Host
$form = $this
->createForm($formHtml, null, 'https://www.foo.com');
$this
->assertEquals('https://login.foo.com/login.php?login_attempt=1', $form
->getUri(), '->getUri() returns absolute URIs set in the action form');
$form = $this
->createForm($formHtml, null, 'https://www.foo.com/bar/');
$this
->assertEquals('https://login.foo.com/login.php?login_attempt=1', $form
->getUri(), '->getUri() returns absolute URIs set in the action form');
}