Test Failed
Push — 1.0.0-dev ( 6506b5...225896 )
by nguereza
05:07
created

CommonTest::testFunctionGetConfigKeyNotExist()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 3
c 1
b 1
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php 
2
3
	use PHPUnit\Framework\TestCase;
4
5
	class CommonTest extends TestCase
6
	{	
7
	
8
		public static function setUpBeforeClass()
9
		{
10
			
11
		}
12
		
13
		public static function tearDownAfterClass()
14
		{
15
			
16
		}
17
	
18
		protected function setUp()
19
		{
20
		}
21
22
		protected function tearDown()
23
		{
24
		}
25
26
		
27
		public function testFunctionGetConfigKeyNotExist(){
28
			$key = 'foo';
29
			$cfg = get_config($key);
30
			$this->assertNull($cfg);
31
		}
32
		
33
		public function testFunctionGetConfigKeyNotExistUsingDefaultValue(){
34
			$key = 'foo';
35
			$expected = 'bar';
36
			$cfg = get_config($key, $expected);
37
			$this->assertEquals($cfg, $expected);
38
		}
39
		
40
		public function testFunctionGetConfigAfterSet(){
41
			$key = 'foo';
42
			$expected = 'bar';
43
			$c = new Config();
44
			$c->init();
45
			$c->set($key, $expected);
46
			$cfg = get_config($key);
47
			$this->assertEquals($cfg, $expected);
48
		}
49
		
50
		public function testVsStream(){
51
		
52
			$vfs =  vfsStream::setup('tnhfw');
53
			$this->assertFalse($vfs->hasChild('test'));
54
			mkdir(vfsStream::url('tnhfw') . DS . 'test');
55
			$this->assertTrue($vfs->hasChild('test'));
56
			echo vfsStream::url('test');
57
			
58
			
59
		}
60
	}