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

ProtectedFieldTest::testFormingWithProtectedField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
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