Test Failed
Push — master ( 811c27...aa94e6 )
by Alexander
06:04
created

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
 * Created by PhpStorm.
4
 * User: horat1us
5
 * Date: 8/6/17
6
 * Time: 5:21 PM
7
 */
8
9
namespace Horat1us\Tests;
10
11
12
use Horat1us\Tests\helpers\XmlWithProtectedField;
13
14
/**
15
 * Class ProtectedFieldTest
16
 * @package Horat1us\Tests
17
 */
18
class ProtectedFieldTest extends \PHPUnit_Framework_TestCase
19
{
20
    public function testFormingWithProtectedField()
21
    {
22
        $object = new XmlWithProtectedField('object');
23
        $document = new \DOMDocument;
24
        $document->appendChild($object->toXml($document));
25
        $string = $document->saveXML();
26
27
        $this->assertEquals(
28
            "<?xml version=\"1.0\"?>\n<XmlWithProtectedField protectedField=\"{$object->getProtectedField()}\"/>\n",
29
            $string
30
        );
31
    }
32
}