BlackHoleTest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /*
  3. * This file is part of the Stash package.
  4. *
  5. * (c) Robert Hafner <tedivm@tedivm.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Stash\Test\Driver;
  11. use Stash\Driver\BlackHole;
  12. /**
  13. * @author Benjamin Zikarsky <benjamin.zikarsky@perbility.de>
  14. */
  15. class BlackHoleTest extends \PHPUnit_Framework_TestCase
  16. {
  17. /**
  18. * @var Stash\Driver\BlackHole
  19. */
  20. private $driver = null;
  21. public function setUp()
  22. {
  23. $this->driver = new BlackHole();
  24. }
  25. public function testPurge()
  26. {
  27. $this->assertTrue($this->driver->purge());
  28. }
  29. public function testStoreData()
  30. {
  31. $this->assertTrue($this->driver->storeData("test", "data", 0));
  32. $this->assertFalse($this->driver->getData("test"));
  33. }
  34. public function testGetData()
  35. {
  36. $this->assertFalse($this->driver->getData("test"));
  37. }
  38. public function testClear()
  39. {
  40. $this->assertTrue($this->driver->clear());
  41. $this->assertTrue($this->driver->clear(null));
  42. $this->assertTrue($this->driver->clear("test"));
  43. }
  44. }