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

CommonTest   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 20
c 1
b 1
f 0
dl 0
loc 52
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A testVsStream() 0 7 1
A testFunctionGetConfigAfterSet() 0 8 1
A tearDown() 0 2 1
A testFunctionGetConfigKeyNotExist() 0 4 1
A tearDownAfterClass() 0 2 1
A setUpBeforeClass() 0 2 1
A testFunctionGetConfigKeyNotExistUsingDefaultValue() 0 5 1
A setUp() 0 2 1
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
	}