ExampleTestCaseWithVfsStream.php 1011 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 'Example.php';
  13. /**
  14. * Test case for class Example.
  15. *
  16. * @package bovigo_vfs
  17. * @subpackage examples
  18. */
  19. class ExampleTestCaseWithVfsStream extends \PHPUnit_Framework_TestCase
  20. {
  21. /**
  22. * root directory
  23. *
  24. * @type vfsStreamDirectory
  25. */
  26. protected $root;
  27. /**
  28. * set up test environmemt
  29. */
  30. public function setUp()
  31. {
  32. $this->root = vfsStream::setup('exampleDir');
  33. }
  34. /**
  35. * @test
  36. */
  37. public function directoryIsCreated()
  38. {
  39. $example = new Example('id');
  40. $this->assertFalse($this->root->hasChild('id'));
  41. $example->setDirectory(vfsStream::url('exampleDir'));
  42. $this->assertTrue($this->root->hasChild('id'));
  43. }
  44. }
  45. ?>