FilePermissionsExampleTestCase.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * This file is part of vfsStream.
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. *
  8. * @package org\bovigo\vfs
  9. */
  10. namespace org\bovigo\vfs\example;
  11. use org\bovigo\vfs\vfsStream;
  12. require_once 'FilePermissionsExample.php';
  13. /**
  14. * Test for FilePermissionsExample.
  15. */
  16. class FilePermissionsExampleTestCase extends \PHPUnit_Framework_TestCase
  17. {
  18. /**
  19. * @test
  20. */
  21. public function directoryWritable()
  22. {
  23. vfsStream::setup('exampleDir');
  24. $example = new FilePermissionsExample();
  25. $example->writeConfig(array('foo' => 'bar'),
  26. vfsStream::url('exampleDir/writable.ini')
  27. );
  28. // assertions here
  29. }
  30. /**
  31. * @test
  32. */
  33. public function directoryNotWritable()
  34. {
  35. vfsStream::setup('exampleDir', 0444);
  36. $example = new FilePermissionsExample();
  37. $example->writeConfig(array('foo' => 'bar'),
  38. vfsStream::url('exampleDir/notWritable.ini')
  39. );
  40. }
  41. }
  42. ?>