8000 [DomCrawler] added support for HTML5 'form' attribute by kepten · Pull Request #7500 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DomCrawler] added support for HTML5 'form' attribute #7500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2013

Conversation

kepten
Copy link
Contributor
@kepten kepten commented Mar 27, 2013
Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #7486
License MIT
Doc PR

} while ('form' != $node->nodeName);
$this->node = $form;
return;
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to use else as the if returns.

@stof
Copy link
Member
stof commented Mar 27, 2013

This is only implementing half of the support of the form attribute: when submitting a form, the input elements with a form attribute referencing it should be part of the submission, even if they are outside the form.

$this->assertTrue(true, '__construct() throws a \\LogicException if the form attribute is invalid');
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make 2 tests, one to test form="bar" is okay, one to test form="nonexistent" throws exception.

@kepten
Copy link
Contributor Author
kepten commented Mar 30, 2013

@stof you were right, I extended it. is it ok now?


$nodeName = $node->nodeName;
private function addField(\DOMNode $node, \DOMNode $button) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the curly brace should be on its own line

@stof
Copy link
Member
stof commented Mar 31, 2013

@kepten Please split the test in 2 different tests as asked by @jfsimon and use @expectedException \LogicException to test the exception. Otherwise, it seems good.

@kepten
Copy link
Contributor Author
kepten commented Mar 31, 2013

@stof @jfsimon Done.

@@ -331,7 +331,7 @@ public function offsetUnset($name)
}

/**
* Sets current \DOMNode instance.
* Expects a 'submit' button and finds the corresponding form element.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not how we document function. The first line must say what it does (something like Sets the node for the form). And then,after a blank line, you can explain what it expects (what you've written here).

@fabpot
Copy link
Member
fabpot commented 8000 Apr 1, 2013

Can you add a note in the component CHANGELOG as this is a new feature?

@kepten
Copy link
Contributor Author
kepten commented Apr 1, 2013

@fabpot Done.

fabpot added a commit that referenced this pull request Apr 7, 2013
This PR was merged into the master branch.

Discussion
----------

[DomCrawler] added support for HTML5 'form' attribute

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7486
| License       | MIT
| Doc PR        |

Commits
-------

f8178dd [DomCrawler] added support for HTML5 'form' attribute
@fabpot fabpot closed this Apr 7, 2013
@fabpot fabpot merged commit f8178dd into symfony:master Apr 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0