Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php declare(strict_types=1); namespace Sabre\DAVACL\Xml\Request; use Sabre\DAV\Xml\Ab..

Decoded Output download

<?php

declare(strict_types=1);

namespace Sabre\DAVACL\Xml\Request;

use Sabre\DAV\Xml\AbstractXmlTestCase;

class PrincipalMatchReportTest extends AbstractXmlTestCase
{
    protected $elementMap = [
        '{DAV:}principal-match' => 'Sabre\DAVACL\Xml\Request\PrincipalMatchReport',
    ];

    public function testDeserialize()
    {
        $xml = <<<XML
<?xml version="1.0" encoding="utf-8" ?>
   <D:principal-match xmlns:D="DAV:">
     <D:principal-property>
       <D:owner/>
     </D:principal-property>
   </D:principal-match>
XML;

        $result = $this->parse($xml);

        self::assertEquals(PrincipalMatchReport::PRINCIPAL_PROPERTY, $result['value']->type);
        self::assertEquals('{DAV:}owner', $result['value']->principalProperty);
    }

    public function testDeserializeSelf()
    {
        $xml = <<<XML
<?xml version="1.0" encoding="utf-8" ?>
   <D:principal-match xmlns:D="DAV:">
     <D:self />
     <D:prop>
        <D:foo />
     </D:prop>
   </D:principal-match>
XML;

        $result = $this->parse($xml);

        self::assertEquals(PrincipalMatchReport::SELF, $result['value']->type);
        self::assertNull($result['value']->principalProperty);
        self::assertEquals(['{DAV:}foo'], $result['value']->properties);
    }
}

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace Sabre\DAVACL\Xml\Request;

use Sabre\DAV\Xml\AbstractXmlTestCase;

class PrincipalMatchReportTest extends AbstractXmlTestCase
{
    protected $elementMap = [
        '{DAV:}principal-match' => 'Sabre\DAVACL\Xml\Request\PrincipalMatchReport',
    ];

    public function testDeserialize()
    {
        $xml = <<<XML
<?xml version="1.0" encoding="utf-8" ?>
   <D:principal-match xmlns:D="DAV:">
     <D:principal-property>
       <D:owner/>
     </D:principal-property>
   </D:principal-match>
XML;

        $result = $this->parse($xml);

        self::assertEquals(PrincipalMatchReport::PRINCIPAL_PROPERTY, $result['value']->type);
        self::assertEquals('{DAV:}owner', $result['value']->principalProperty);
    }

    public function testDeserializeSelf()
    {
        $xml = <<<XML
<?xml version="1.0" encoding="utf-8" ?>
   <D:principal-match xmlns:D="DAV:">
     <D:self />
     <D:prop>
        <D:foo />
     </D:prop>
   </D:principal-match>
XML;

        $result = $this->parse($xml);

        self::assertEquals(PrincipalMatchReport::SELF, $result['value']->type);
        self::assertNull($result['value']->principalProperty);
        self::assertEquals(['{DAV:}foo'], $result['value']->properties);
    }
}

Function Calls

None

Variables

None

Stats

MD5 b7fccd56c6fc4fe6e36582fb5edeea26
Eval Count 0
Decode Time 129 ms