Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
56 changes: 28 additions & 28 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/ValueObject/Uuid.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Uuid extends Type\AbstractSingleValue implements Identifier
{
protected function validator()
{
return parent::validator()->regex('/([a-f\d]{8}(-[a-f\d]{4}){3}-[a-f\d]{12}?)/i');
return parent::validator()->regex('/([a-f\d]{8}(-[a-f\d]{4}){3}-[a-f\d]{12}?)$/i');
}

public function is_null()
Expand Down
2 changes: 1 addition & 1 deletion test/Deserializer/CompositeErrorReporting.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function test_reporting_when_values_are_wrong()
$exception = $this->fail_elegantly($encoded);

$expected = [
"id" => ['"1234" must validate against "/([a-f\\\\d]{8}(-[a-f\\\\d]{4}){3}-[a-f\\\\d]{12}?)/i"'],
"id" => ['"1234" must validate against "/([a-f\\\\d]{8}(-[a-f\\\\d]{4}){3}-[a-f\\\\d]{12}?)$/i"'],
"date" => ['"saads" must be a valid date']
];

Expand Down
6 changes: 6 additions & 0 deletions test/ValueObject/Uuid.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ public function test_invalid_value()
$this->setExpectedException(Assert\Exception::class);
new Uuid("asdfasdf");
}

public function test_fails_if_the_uuid_is_too_long()
{
$this->setExpectedException(Assert\Exception::class);
new Uuid("ac9e4e83-5495-4a58-90d9-eeeaf3989bc8a");
}
}