Passed
Push — master ( 4f9e3a...139be2 )
by Alexander
23:24
created

ProtectedFieldTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 15
rs 10
1
<?php
2
3
namespace Horat1us\Tests;
4
5
use Horat1us\Tests\helpers\XmlWithProtectedField;
6
use PHPUnit\Framework\TestCase;
7
8
class ProtectedFieldTest extends TestCase
9
{
10
    public function testFormingWithProtectedField()
11
    {
12
        $object = new XmlWithProtectedField('object');
13
        $document = new \DOMDocument();
14
        $document->appendChild($object->toXml($document));
15
        $string = $document->saveXML();
16
17
        $this->assertEquals(
18
            "<?xml version=\"1.0\"?>\n<XmlWithProtectedField protectedField=\"{$object->getProtectedField()}\"/>\n",
19
            $string
20
        );
21
    }
22
}
23