本文整理汇总了PHP中TYPO3\CMS\Core\Resource\ResourceStorage::isWritable方法的典型用法代码示例。如果您正苦于以下问题:PHP ResourceStorage::isWritable方法的具体用法?PHP ResourceStorage::isWritable怎么用?PHP ResourceStorage::isWritable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Resource\ResourceStorage
的用法示例。
在下文中一共展示了ResourceStorage::isWritable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: capabilitiesOfStorageObjectAreCorrectlySet
/**
* @test
* @dataProvider capabilitiesDataProvider
* @TODO: Rewrite or move to functional suite
*/
public function capabilitiesOfStorageObjectAreCorrectlySet(array $capabilities)
{
$this->markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
$storageRecord = array('is_public' => $capabilities['public'], 'is_writable' => $capabilities['writable'], 'is_browsable' => $capabilities['browsable'], 'is_online' => true);
$mockedDriver = $this->createDriverMock(array('pathType' => 'relative', 'basePath' => 'fileadmin/'), $this->subject, null);
$this->prepareSubject(array(), false, $mockedDriver, $storageRecord);
$this->assertEquals($capabilities['public'], $this->subject->isPublic(), 'Capability "public" is not correctly set.');
$this->assertEquals($capabilities['writable'], $this->subject->isWritable(), 'Capability "writable" is not correctly set.');
$this->assertEquals($capabilities['browsable'], $this->subject->isBrowsable(), 'Capability "browsable" is not correctly set.');
}
示例2: capabilitiesOfStorageObjectAreCorrectlySet
/**
* @test
* @dataProvider capabilitiesDataProvider
*/
public function capabilitiesOfStorageObjectAreCorrectlySet(array $capabilites)
{
$storageRecord = array('is_public' => $capabilites['public'], 'is_writable' => $capabilites['writable'], 'is_browsable' => $capabilites['browsable'], 'is_online' => TRUE);
$mockedDriver = $this->createDriverMock(array(), $this->fixture, array('hasCapability'));
$mockedDriver->expects($this->any())->method('hasCapability')->will($this->returnValue(TRUE));
$this->prepareFixture(array(), FALSE, $mockedDriver, $storageRecord);
$this->assertEquals($capabilites['public'], $this->fixture->isPublic(), 'Capability "public" is not correctly set.');
$this->assertEquals($capabilites['writable'], $this->fixture->isWritable(), 'Capability "writable" is not correctly set.');
$this->assertEquals($capabilites['browsable'], $this->fixture->isBrowsable(), 'Capability "browsable" is not correctly set.');
}
示例3: isEquivalentObjectStorage
/**
* Determines whether the passed storage object and record (sys_file_storage) can be
* seen as equivalent during import.
*
* @param ResourceStorage $storageObject The storage object which should get compared
* @param array $storageRecord The storage record which should get compared
* @return bool Returns TRUE when both object storages can be seen as equivalent
*/
protected function isEquivalentObjectStorage(ResourceStorage $storageObject, array $storageRecord)
{
// compare the properties: driver, writable and online
if ($storageObject->getDriverType() === $storageRecord['driver'] && (bool) $storageObject->isWritable() === (bool) $storageRecord['is_writable'] && (bool) $storageObject->isOnline() === (bool) $storageRecord['is_online']) {
$storageRecordConfiguration = ResourceFactory::getInstance()->convertFlexFormDataToConfigurationArray($storageRecord['configuration']);
$storageObjectConfiguration = $storageObject->getConfiguration();
// compare the properties: pathType and basePath
if ($storageRecordConfiguration['pathType'] === $storageObjectConfiguration['pathType'] && $storageRecordConfiguration['basePath'] === $storageObjectConfiguration['basePath']) {
return true;
}
}
return false;
}