laravel-embed
laravel-embed copied to clipboard
Validation Rule try/catch mismatch causes passed exception
In ValueObjects/Url.php __construct you are throwing InvalidArgumentException but your try new Url($value) in Rules/EmbeddableUrl.php is catching ServiceNotFoundException so the exception is thrown.
Also FWIW Illuminate\Contracts\Validation\Rule is being deprecated in favor of Illuminate\Contracts\Validation\ValidationRule
If you update test_it_fails_for_an_invalid_url in EmbeddableUrlTest.php like so, your test will fail
public function test_it_fails_for_an_invalid_url()
{
$this->assertFalse(
(new EmbeddableUrl)
->passes('', '[xyz]')
);
}