public function testGetOverride() { $this->
setSettings('test'
);
$php = PhpStorageFactory::
get('test'
);
// The FileReadOnlyStorage should be used from settings.
$this->
assertInstanceOf(MockPhpStorage::
class,
$php);
// Test that the name is used for the bin when it is NULL.
$this->
setSettings('test',
['bin' => NULL
]);
$php = PhpStorageFactory::
get('test'
);
$this->
assertInstanceOf(MockPhpStorage::
class,
$php);
$this->
assertSame('test',
$php->
getConfigurationValue('bin'
), 'Name value was used for bin.'
);
// Test that a default directory is set if it's empty.
$this->
setSettings('test',
['directory' => NULL
]);
$php = PhpStorageFactory::
get('test'
);
$this->
assertInstanceOf(MockPhpStorage::
class,
$php);
$this->
assertSame(PublicStream::
basePath() . '/php',
$php->
getConfigurationValue('directory'
), 'Default file directory was used.'
);
// Test that a default storage class is set if it's empty.
$this->
setSettings('test',
['class' => NULL
]);
$php = PhpStorageFactory::
get('test'
);
$this->
assertInstanceOf(MTimeProtectedFileStorage::
class,
$php);