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

add assertions for not matching regexes #261

Merged
merged 5 commits into from
Oct 11, 2018
Merged

add assertions for not matching regexes #261

merged 5 commits into from
Oct 11, 2018

Conversation

mimmi20
Copy link
Contributor

@mimmi20 mimmi20 commented Oct 2, 2018

I would like to add two new assertions I want to use.


if (\preg_match($pattern, $value)) {
$message = \sprintf(
static::generateMessage($message ?: 'Value "%s" does match expression.'),
Copy link
Contributor

Choose a reason for hiding this comment

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

'does match' => 'matches'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


if (!\file_exists($value)) {
$message = \sprintf(
static::generateMessage($message ?: 'Path "%s" was expected to be exsting.'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Assert::file() covers this assertion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

assertion and test removed

README.md Outdated
@@ -204,6 +204,7 @@ Assertion::extensionLoaded(mixed $value);
Assertion::extensionVersion(string $extension, string $operator, mixed $version);
Assertion::false(mixed $value);
Assertion::file(string $value);
Assertion::fileExists(string $value);
Copy link
Contributor

Choose a reason for hiding this comment

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

Rebuild the documentation please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@rquadling rquadling merged commit 7c20183 into beberlei:master Oct 11, 2018
@rquadling
Copy link
Contributor

Thank you.

rquadling pushed a commit that referenced this pull request Oct 11, 2018
* 'master' of github.com:beberlei/assert:
  add assertions for existing files and not matching regexes (#261)

# Conflicts:
#	lib/Assert/Assertion.php
@rquadling rquadling changed the title add assertions for existing files and not matching regexes add assertions for not matching regexes Oct 11, 2018
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.

2 participants