Total Complexity | 1 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class ItemTest extends CommonTestClass |
||
10 | { |
||
11 | public function testSimple() |
||
12 | { |
||
13 | $data = $this->mockItem(); |
||
14 | $this->assertInstanceOf('\kalanis\kw_templates\Template\Item', $data); |
||
15 | $this->assertEquals('testing content', $data->getKey()); |
||
16 | $this->assertEquals('default content %s', $data->getDefault()); |
||
17 | $this->assertEquals('default content %s', $data->getValue()); |
||
18 | |||
19 | $data->setValue('different %s %s'); |
||
20 | $this->assertNotEquals('default content %s', $data->getValue()); |
||
21 | $this->assertEquals('different %s %s', $data->getValue()); |
||
22 | |||
23 | $data->updateValue('conv', 'val'); |
||
24 | $this->assertEquals('different conv val', $data->getValue()); |
||
25 | |||
26 | $data->setValue(null); |
||
27 | $data->updateValue('conv', 'val'); |
||
28 | $this->assertEquals('default content conv', $data->getValue()); |
||
29 | |||
30 | $data2 = clone $data; |
||
31 | $data2->setData('new test', 'another content %f'); |
||
32 | $this->assertEquals('new test', $data2->getKey()); |
||
33 | $this->assertNotEquals('new test', $data->getKey()); |
||
34 | } |
||
36 |