for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace SimpleSAML\XMLSecurity\Test\XML\xenc;
use PHPUnit\Framework\TestCase;
use SimpleSAML\Assert\AssertionFailedException;
use SimpleSAML\XML\DOMDocumentFactory;
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait;
use SimpleSAML\XMLSecurity\Test\XML\XMLDumper;
use SimpleSAML\XMLSecurity\XML\xenc\CipherValue;
use function dirname;
use function strval;
/**
* Class \SimpleSAML\XMLSecurity\Test\XML\xenc\CipherValueTest
*
* @covers \SimpleSAML\XMLSecurity\XML\xenc\AbstractXencElement
* @covers \SimpleSAML\XMLSecurity\XML\xenc\CipherValue
* @package simplesamlphp/xml-security
*/
final class CipherValueTest extends TestCase
{
use SerializableElementTestTrait;
SimpleSAML\XML\TestUtils...lizableElementTestTrait
$documentElement
SimpleSAML\XMLSecurity\T...ML\xenc\CipherValueTest
public static function setUpBeforeClass(): void
self::$testedClass = CipherValue::class;
self::$xmlRepresentation = DOMDocumentFactory::fromFile(
dirname(__FILE__, 3) . '/resources/xml/xenc_CipherValue.xml',
);
}
public function testMarshalling(): void
$cipherValue = new CipherValue('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=');
$this->assertEquals(
XMLDumper::dumpDOMDocumentXMLWithBase64Content(self::$xmlRepresentation),
strval($cipherValue),
public function testMarshallingNotBase64(): void
$this->expectException(AssertionFailedException::class);
new CipherValue('/CTj3d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=');