ExampleTestCaseOldWay.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. require_once 'Example.php';
  12. /**
  13. * Test case for class Example.
  14. */
  15. class ExampleTestCaseOldWay extends \PHPUnit_Framework_TestCase
  16. {
  17. /**
  18. * set up test environmemt
  19. */
  20. public function setUp()
  21. {
  22. if (file_exists(__DIR__ . '/id') === true) {
  23. rmdir(__DIR__ . '/id');
  24. }
  25. }
  26. /**
  27. * clear up test environment
  28. */
  29. public function tearDown()
  30. {
  31. if (file_exists(__DIR__ . '/id') === true) {
  32. rmdir(__DIR__ . '/id');
  33. }
  34. }
  35. /**
  36. * @test
  37. */
  38. public function directoryIsCreated()
  39. {
  40. $example = new Example('id');
  41. $this->assertFalse(file_exists(__DIR__ . '/id'));
  42. $example->setDirectory(__DIR__);
  43. $this->assertTrue(file_exists(__DIR__ . '/id'));
  44. }
  45. }
  46. ?>