__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace Tuf\Tests\Metadata;
trait UntrustedExceptionTrait
{
/**
* Tests that accessing method that with untrusted metadata throws an exception.
*
* @param string $method
* The method to call.
* @param array $args
* The arguments for the method.
*
* @dataProvider providerUntrustedException
*
* @return void
*/
public function testUntrustedException(string $method, array $args = []): void
{
$data = json_decode($this->clientStorage->read($this->validJson), true);
$metadata = static::callCreateFromJson(json_encode($data));
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage("Cannot use untrusted '{$this->expectedType}'. metadata.");
$method = new \ReflectionMethod($metadata, $method);
$method->invokeArgs($metadata, $args);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| MetaDataBaseTest.php | File | 13.7 KB | 0664 |
|
| RootMetadataTest.php | File | 7.49 KB | 0664 |
|
| SnapshotMetadataTest.php | File | 1.97 KB | 0664 |
|
| TargetsMetadataTest.php | File | 8.71 KB | 0664 |
|
| TimestampMetadataTest.php | File | 2.22 KB | 0664 |
|
| UntrustedExceptionTrait.php | File | 894 B | 0664 |
|