Example #1
0
 /**
  * Asserts the stream is writable
  *
  * @throws Magento_Filesystem_Exception
  */
 protected function _assertWritable()
 {
     $this->_assertOpened();
     if (false === $this->_mode->isWriteAllowed()) {
         throw new Magento_Filesystem_Exception('The stream does not allow write.');
     }
 }
Example #2
0
 /**
  * @dataProvider wModesDataProvider
  * @param string $mode
  */
 public function testAllowsWrite($mode)
 {
     $streamMode = new Magento_Filesystem_Stream_Mode($mode);
     $this->assertTrue($streamMode->isWriteAllowed());
 }