/** * Tests writings fails in setMicrotime(). * * @expectedException bandwidthThrottle\tokenBucket\storage\StorageException */ public function testSetMicrotimeFailsWriting() { $this->getFunctionMock(__NAMESPACE__, "fwrite")->expects($this->atLeastOnce())->willReturn(false); vfsStream::setup('test'); $storage = new FileStorage(vfsStream::url("test/data")); $storage->setMicrotime(1.1234); }