You are here

public function vfsStreamFileTestCase::truncateToGreaterSizeAddsZeroBytes in Zircon Profile 8

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

@test @group issue_33 @since 1.1.0

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamFileTestCase.php, line 270

Class

vfsStreamFileTestCase
Test for org\bovigo\vfs\vfsStreamFile.

Namespace

org\bovigo\vfs

Code

public function truncateToGreaterSizeAddsZeroBytes() {
  $this
    ->assertEquals(11, $this->file
    ->write("lorem ipsum"));
  $this
    ->assertTrue($this->file
    ->truncate(25));
  $this
    ->assertEquals(25, $this->file
    ->size());
  $this
    ->assertEquals("lorem ipsum\0\0\0\0\0\0\0\0\0\0\0\0\0\0", $this->file
    ->getContent());
}