8000 Fix URL validator failure with empty string by fabpot · Pull Request #16152 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix URL validator failure with empty string #16152

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 2 commits into from
Oct 6, 2015
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
Next Next commit
[Validator] added a failing test
  • Loading branch information
fabpot committed Oct 6, 2015
commit 0f618596794f2040e590e77fd1b15c69c9b45cea
Original file line number Diff line number Diff line change
8633 Expand Up @@ -35,6 +35,13 @@ public function testEmptyStringIsValid()
$this->assertNoViolation();
}

public function testEmptyStringFromObjectIsValid()
{
$this->validator->validate(new EmailProvider(), new Url());

$this->assertNoViolation();
}

/**
* @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException
*/
Expand Down Expand Up @@ -171,3 +178,11 @@ public function getValidCustomUrls()
);
}
}

class EmailProvider
{
public function __toString()
{
return '';
}
}
0