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 File and Directory constraints and assertions #2262

Closed
wants to merge 1 commit into from
Closed

add File and Directory constraints and assertions #2262

wants to merge 1 commit into from

Conversation

abacaphiliac
Copy link
Sponsor Contributor

add Constraints:

  • PHPUnit_Framework_Constraint_DirectoryExists
  • PHPUnit_Framework_Constraint_IsReadable
  • PHPUnit_Framework_Constraint_IsWritable

add Assertions:

  • assertIsReadable
  • assertNotIsReadable
  • assertIsWritable
  • assertNotIsWritable
  • assertDirectoryExists
  • assertDirectoryNotExists
  • assertDirectoryIsReadable
  • assertDirectoryNotIsReadable
  • assertDirectoryIsWritable
  • assertDirectoryNotIsWritable
  • assertFileIsReadable
  • assertFileNotIsReadable
  • assertFileIsWritable
  • assertFileNotIsWritable

added tests to completely cover the constraints, and tests to cover most of the assertions... however it will be difficult/impossible to completely test some of the assertions without using a virtual filesystem. how do you feel about my inclusion of mikey179/vfsStream or a similar package for this purpose?

…ble, and DirectoryExists, with convenience assertions to ensure that files and directories are or are not readable and writable.
@sebastianbergmann sebastianbergmann added the type/enhancement A new idea that should be implemented label Aug 5, 2016
@sebastianbergmann
Copy link
Owner

Thank you for your contribution.

I am considering merging this for PHPUnit 5.6. Can you please open a pull request for https://github.com/sebastianbergmann/phpunit-documentation that documents these new assertions?

@abacaphiliac
Copy link
Sponsor Contributor Author

@sebastianbergmann thanks for making projects that are so easy to build and in which to contribute : )

here are the new docs: sebastianbergmann/phpunit-documentation#382

please let me know if i have missed anything, or if it looks out of sorts.

@mingca
Copy link

mingca commented Aug 24, 2016

@sebastianbergmann Thanks for the efforts
@abacaphiliac you too

@sebastianbergmann sebastianbergmann added this to the PHPUnit 5.6 milestone Sep 21, 2016
@sebastianbergmann
Copy link
Owner

Merged manually, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A new idea that should be implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants