Skip to content
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

[5.2] Fix seeIsSelected for <option> tags without value attribute #14279

Merged
merged 4 commits into from
Jul 12, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Illuminate/Foundation/Testing/Constraints/IsSelected.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\Foundation\Testing\Constraints;

use DOMElement;
use Symfony\Component\DomCrawler\Crawler;

class IsSelected extends FormFieldConstraint
Expand Down Expand Up @@ -74,12 +75,12 @@ protected function getSelectedValueFromSelect(Crawler $select)
/**
* Get the selected value from an option element.
*
* @param \DOMElement $option
* @param DOMElement $option
Copy link
Member

Choose a reason for hiding this comment

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

Please keep the slash here.

* @return string
*/
protected function getOptionValue(\DOMElement $option)
protected function getOptionValue(DOMElement $option)
{
if($option->hasAttribute('value')){
if ($option->hasAttribute('value')) {
return $option->getAttribute('value');
}
return $option->textContent;
Expand Down