You are here

public function vfsStreamWrapperTestCase::truncateRemovesSuperflouosContent in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperTestCase.php \org\bovigo\vfs\vfsStreamWrapperTestCase::truncateRemovesSuperflouosContent()

@test @group issue_33 @since 1.1.0 @requires PHP 5.4.0

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperTestCase.php, line 626

Class

vfsStreamWrapperTestCase
Test for org\bovigo\vfs\vfsStreamWrapper.

Namespace

org\bovigo\vfs

Code

public function truncateRemovesSuperflouosContent() {
  if (strstr(PHP_VERSION, 'hiphop') !== false) {
    $this
      ->markTestSkipped('Not supported on hhvm');
  }
  $handle = fopen($this->baz1URL, "r+");
  $this
    ->assertTrue(ftruncate($handle, 0));
  $this
    ->assertEquals(0, filesize($this->baz1URL));
  $this
    ->assertEquals('', file_get_contents($this->baz1URL));
  fclose($handle);
}