You are here

public function HttpStreamWrapperTest::testStreamLock in Remote Stream Wrapper 8

Test that we always return TRUE for locks.

@covers ::stream_lock

File

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

Class

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

Namespace

Drupal\Tests\remote_stream_wrapper\Unit

Code

public function testStreamLock() {
  $wrapper = new HttpStreamWrapper();
  $wrapper
    ->setUri('http://example.com/test.txt');
  foreach ([
    LOCK_SH,
    LOCK_EX,
    LOCK_UN,
    LOCK_NB,
  ] as $type) {
    $this
      ->assertTrue($wrapper
      ->stream_lock($type));
  }
}