vfsStreamBlockTestCase.php in Zircon Profile 8
File
vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamBlockTestCase.php
View source
<?php
namespace org\bovigo\vfs;
class vfsStreamBlockTestCase extends \PHPUnit_Framework_TestCase {
protected $block;
public function setUp() {
$this->block = new vfsStreamBlock('foo');
}
public function defaultValues() {
$this
->assertEquals(vfsStreamContent::TYPE_BLOCK, $this->block
->getType());
$this
->assertEquals('foo', $this->block
->getName());
$this
->assertTrue($this->block
->appliesTo('foo'));
$this
->assertFalse($this->block
->appliesTo('foo/bar'));
$this
->assertFalse($this->block
->appliesTo('bar'));
}
public function external() {
$root = vfsStream::setup('root');
$root
->addChild(vfsStream::newBlock('foo'));
$this
->assertEquals('block', filetype(vfsStream::url('root/foo')));
}
public function addStructure() {
$structure = array(
'topLevel' => array(
'thisIsAFile' => 'file contents',
'[blockDevice]' => 'block contents',
),
);
$root = vfsStream::create($structure);
$this
->assertSame('block', filetype(vfsStream::url('root/topLevel/blockDevice')));
}
public function createWithEmptyName() {
$structure = array(
'topLevel' => array(
'thisIsAFile' => 'file contents',
'[]' => 'block contents',
),
);
$root = vfsStream::create($structure);
}
}