public function testSettingVisibility() { $path = '/test.txt'; $config = new Config(['visibility' => AdapterInterface::VISIBILITY_PUBLIC]); $meta = $this->adapter->write($path, 'Some Content', $config); $this->adapter->setVisibility($path, AdapterInterface::VISIBILITY_PRIVATE); $rows = [['visibility' => AdapterInterface::VISIBILITY_PRIVATE]]; $expected = (new ArrayDataSet(['flysystem_path' => $rows]))->getTable('flysystem_path'); $select = "SELECT visibility FROM flysystem_path WHERE path_id = {$meta['path_id']}"; $actual = $this->getConnection()->createQueryTable('flysystem_path', $select); $this->assertTablesEqual($expected, $actual); }
public function testSetVisibilityWithDbFailure() { $this->setupBasicDbResponse(false); $meta = $this->adapter->setVisibility('/path/to/file.txt', AdapterInterface::VISIBILITY_PRIVATE); $this->assertFalse($meta); }