Test Failed
Push — master ( 811c27...aa94e6 )
by Alexander
06:04
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 Method

Rating   Name   Duplication   Size   Complexity  
A testFormingWithProtectedField() 0 12 1
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
}