org\bovigo\vfs\vfsStreamWrapperQuotaTestCase::truncateConsidersAllFilesForQuota PHP Method

truncateConsidersAllFilesForQuota() public method

    public function truncateConsidersAllFilesForQuota()
    {
        if (version_compare(PHP_VERSION, '5.4.0', '<')) {
            $this->markTestSkipped('Requires PHP 5.4');
        }
        if (strstr(PHP_VERSION, 'hiphop') !== false) {
            $this->markTestSkipped('Not supported on hhvm');
        }
        vfsStream::newFile('bar.txt')->withContent('bar')->at(vfsStream::newDirectory('bar')->at($this->root));
        $fp = fopen(vfsStream::url('root/file.txt'), 'w+');
        $this->assertTrue(ftruncate($fp, 11));
        fclose($fp);
        $this->assertEquals(7, $this->root->getChild('file.txt')->size());
        $this->assertEquals("", $this->root->getChild('file.txt')->getContent());
    }