Example #1
0
 /**
  * Asserts the stream is readable
  *
  * @throws Magento_Filesystem_Exception
  */
 protected function _assertReadable()
 {
     $this->_assertOpened();
     if (false === $this->_mode->isReadAllowed()) {
         throw new Magento_Filesystem_Exception('The stream does not allow read.');
     }
 }
Example #2
0
 /**
  * @dataProvider rModesDataProvider
  * @param string $mode
  */
 public function testAllowRead($mode)
 {
     $streamMode = new Magento_Filesystem_Stream_Mode($mode);
     $this->assertTrue($streamMode->isReadAllowed());
 }