You are here

public function HttpStreamWrapperTest::testStreamConfiguration in Remote Stream Wrapper 8

Test that the wrapper constants.

@covers ::getType @covers ::getName @covers ::getDescription

File

tests/src/Unit/HttpStreamWrapperTest.php, line 23

Class

HttpStreamWrapperTest
@group remote_stream_wrapper @coversDefaultClass \Drupal\remote_stream_wrapper\StreamWrapper\HttpStreamWrapper

Namespace

Drupal\Tests\remote_stream_wrapper\Unit

Code

public function testStreamConfiguration() {
  $type = HttpStreamWrapper::getType();
  $this
    ->assertEquals(StreamWrapperInterface::READ & StreamWrapperInterface::HIDDEN, $type);
  $this
    ->assertEquals($type & StreamWrapperInterface::LOCAL, 0);
  $this
    ->assertNotEquals($type & StreamWrapperInterface::READ, 0);
  $this
    ->assertEquals($type & StreamWrapperInterface::WRITE, 0);
  $this
    ->assertEquals($type & StreamWrapperInterface::VISIBLE, 0);
  $this
    ->assertNotEquals($type & StreamWrapperInterface::HIDDEN, 0);

  //$this->assertEquals($type & StreamWrapperInterface::LOCAL_HIDDEN, 0);

  //$this->assertEquals($type & StreamWrapperInterface::WRITE_VISIBLE, 0);
  $this
    ->assertNotEquals($type & StreamWrapperInterface::READ_VISIBLE, 0);

  //$this->assertEquals($type & StreamWrapperInterface::NORMAL, 0);

  //$this->assertEquals($type & StreamWrapperInterface::LOCAL_NORMAL, 0);
  $wrapper = new HttpStreamWrapper(new Client());
  $this
    ->assertInternalType('string', $wrapper
    ->getName());
  $this
    ->assertInternalType('string', $wrapper
    ->getDescription());
}