scratch – Blame information for rev

Subversion Repositories:
Rev:
Rev Author Line No. Line
115 office 1 <?php
2  
3 namespace Tests\FFMpeg\Unit\FFProbe\DataMapping;
4  
5 use Tests\FFMpeg\Unit\TestCase;
6 use FFMpeg\FFProbe\DataMapping\AbstractData;
7  
8 class AbstractDataTest extends TestCase
9 {
10 public function testHas()
11 {
12 $imp = new Implementation(array('key1' => 'value1', 'key2' => 'value2'));
13  
14 $this->assertTrue($imp->has('key1'));
15 $this->assertTrue($imp->has('key2'));
16 $this->assertFalse($imp->has('value1'));
17 $this->assertFalse($imp->has('key3'));
18 }
19  
20 public function testGet()
21 {
22 $imp = new Implementation(array('key1' => 'value1', 'key2' => 'value2'));
23  
24 $this->assertEquals('value1', $imp->get('key1'));
25 $this->assertEquals('value2', $imp->get('key2'));
26 }
27  
28 public function testGetDefault()
29 {
30 $imp = new Implementation(array('key1' => 'value1', 'key2' => 'value2'));
31 $this->assertSame('yololo', $imp->get('key3', 'yololo'));
32 }
33  
34 public function testKeys()
35 {
36 $imp = new Implementation(array('key1' => 'value1', 'key2' => 'value2'));
37  
38 $this->assertEquals(array('key1', 'key2'), $imp->keys());
39 }
40  
41 public function testAll()
42 {
43 $values = array('key1' => 'value1', 'key2' => 'value2');
44 $imp = new Implementation($values);
45  
46 $this->assertEquals($values, $imp->all());
47 }
48 }
49  
50 class Implementation extends AbstractData
51 {
52 }