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\ds;
use PHPUnit\Framework\TestCase;
use SimpleSAML\XML\DOMDocumentFactory;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait;
use SimpleSAML\XMLSecurity\Test\XML\XMLDumper;
use SimpleSAML\XMLSecurity\XML\ds\Exponent;
use function dirname;
use function strval;
/**
* Class \SimpleSAML\XMLSecurity\Test\XML\ds\ExponentTest
*
* @covers \SimpleSAML\XMLSecurity\XML\ds\AbstractDsElement
* @covers \SimpleSAML\XMLSecurity\XML\ds\Exponent
* @package simplesamlphp/xml-security
*/
final class ExponentTest extends TestCase
{
use SerializableElementTestTrait;
SimpleSAML\XML\TestUtils...lizableElementTestTrait
$documentElement
SimpleSAML\XMLSecurity\Test\XML\ds\ExponentTest
public static function setUpBeforeClass(): void
self::$testedClass = Exponent::class;
self::$xmlRepresentation = DOMDocumentFactory::fromFile(
dirname(__FILE__, 3) . '/resources/xml/ds_Exponent.xml',
);
}
public function testMarshalling(): void
$exponent = new Exponent('dGhpcyBpcyBzb21lIHJhbmRvbSBleHBvbmVudAo=');
$this->assertEquals(
XMLDumper::dumpDOMDocumentXMLWithBase64Content(self::$xmlRepresentation),
strval($exponent),
public function testMarshallingNotBase64(): void
$this->expectException(SchemaViolationException::class);
new Exponent('/CTj3d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=');