Advertisement
Guest User

Untitled

a guest
May 18th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.64 KB | None | 0 0
  1. Index: CommonBackendTest.php
  2. ===================================================================
  3. --- CommonBackendTest.php   (revision 24811)
  4. +++ CommonBackendTest.php   (working copy)
  5. @@ -280,6 +280,20 @@
  6.          $this->assertFalse($this->_instance->test('bar3'));
  7.      }
  8.  
  9. +    public function testCleanModeMatchingAnyTags()
  10. +    {
  11. +        $this->assertTrue($this->_instance->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array('tag1')));
  12. +        $this->assertTrue($this->_instance->test('bar') > 999999);
  13. +        $this->assertTrue($this->_instance->test('bar3') > 999999);
  14. +        $this->assertFalse($this->_instance->test('bar2'));
  15. +    }
  16. +
  17. +    public function testCleanModeMatchingAnyTags2()
  18. +    {
  19. +        $this->assertTrue($this->_instance->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array('tag4', 'tag1')));
  20. +        $this->assertFalse($this->_instance->test('bar'));
  21. +        $this->assertFalse($this->_instance->test('bar2'));
  22. +        $this->assertTrue($this->_instance->test('bar3') > 999999);
  23. +    }
  24.  }
  25.  
  26. -
  27. Index: CommonExtendedBackendTest.php
  28. ===================================================================
  29. --- CommonExtendedBackendTest.php   (revision 24811)
  30. +++ CommonExtendedBackendTest.php   (working copy)
  31. @@ -173,6 +173,41 @@
  32.          $this->assertTrue(in_array('bar3', $res));
  33.      }
  34.  
  35. +    public function testGetIdsMatchingAnyTags()
  36. +    {
  37. +        if (!($this->_capabilities['tags'])) {
  38. +            # unsupported by this backend
  39. +            return;
  40. +        }
  41. +        $res = $this->_instance->getIdsMatchingAnyTags(array('tag5'));
  42. +        $this->assertTrue(count($res) == 0);
  43. +    }
  44. +
  45. +    public function testGetIdsMatchingAnyTags2()
  46. +    {
  47. +        if (!($this->_capabilities['tags'])) {
  48. +            # unsupported by this backend
  49. +            return;
  50. +        }
  51. +        $res = $this->_instance->getIdsMatchingAnyTags(array('tag3'));
  52. +        $this->assertTrue(count($res) == 3);
  53. +        $this->assertTrue(in_array('bar', $res));
  54. +        $this->assertTrue(in_array('bar2', $res));
  55. +        $this->assertTrue(in_array('bar3', $res));
  56. +    }
  57. +
  58. +    public function testGetIdsMatchingAnyTags3()
  59. +    {
  60. +        if (!($this->_capabilities['tags'])) {
  61. +            # unsupported by this backend
  62. +            return;
  63. +        }
  64. +        $res = $this->_instance->getIdsMatchingAnyTags(array('tag2', 'tag4'));
  65. +        $this->assertTrue(count($res) == 2);
  66. +        $this->assertTrue(in_array('bar', $res));
  67. +        $this->assertTrue(in_array('bar3', $res));
  68. +    }
  69. +
  70.      public function testGetMetadatas($notag = false)
  71.      {
  72.          $res = $this->_instance->getMetadatas('bar');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement