/** * @covers mychaelstyle\storage\File::rollback * @covers mychaelstyle\storage\Storage::rollback * @covers mychaelstyle\storage\File::initialize * @covers mychaelstyle\storage\File::clean * @covers mychaelstyle\storage\File::remove * @covers mychaelstyle\storage\File::isOpened * @covers mychaelstyle\storage\File::checkOpen */ public function testRollback() { // remove first $this->object->remove(); // create new storage without transaction $this->storage = new \mychaelstyle\Storage($this->dsn, $this->options, false); $this->object = $this->storage->createFile($this->uri, $this->options, false); // none transaxtion $expected = $this->test_string; $this->object->open('w'); $this->object->write($expected); $this->object->close(); $localPath = $this->getLocalPathUsingUri($this->dsn, $this->uri); $this->assertFalse(file_exists($localPath)); $this->object->rollback(); $this->assertFalse(file_exists($localPath)); }