+
+ /**
+ * @covers BagOStuff::lock()
+ * @covers BagOStuff::unlock()
+ */
+ public function testLocking() {
+ $key = 'test';
+ $this->assertTrue( $this->cache->lock( $key ) );
+ $this->assertFalse( $this->cache->lock( $key ) );
+ $this->assertTrue( $this->cache->unlock( $key ) );
+
+ $key2 = 'test2';
+ $this->assertTrue( $this->cache->lock( $key2, 5, 5, 'rclass' ) );
+ $this->assertTrue( $this->cache->lock( $key2, 5, 5, 'rclass' ) );
+ $this->assertTrue( $this->cache->unlock( $key2 ) );
+ $this->assertTrue( $this->cache->unlock( $key2 ) );
+ }