__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php

namespace Tuf\Tests\Metadata;

use Tuf\Metadata\MetadataBase;
use Tuf\Metadata\SnapshotMetadata;

/**
 * @coversDefaultClass \Tuf\Metadata\SnapshotMetadata
 */
class SnapshotMetadataTest extends MetadataBaseTest
{
    use UntrustedExceptionTrait;

    /**
     * {@inheritdoc}
     */
    protected $validJson = '1.snapshot';

    /**
     * {@inheritdoc}
     */
    protected $expectedType = 'snapshot';

    /**
     * {@inheritdoc}
     */
    protected static function callCreateFromJson(string $json): MetadataBase
    {
        return SnapshotMetadata::createFromJson($json);
    }
    /**
     * {@inheritdoc}
     */
    public function providerExpectedField(): array
    {
        $data = parent::providerExpectedField();
        $data[] = ['signed:meta'];
        $data[] = ['signed:meta:targets.json', 'This collection should contain 1 element or more.'];
        $data[] = ['signed:meta:targets.json:version'];
        return $data;
    }

    /**
     * {@inheritdoc}
     */
    public function providerValidField(): array
    {
        $data = parent::providerValidField();
        $data[] = ['signed:meta', 'array'];
        $data[] = ['signed:meta:targets.json', 'array'];
        $data[] = ['signed:meta:targets.json:version', 'int'];
        return $data;
    }

    /**
     * {@inheritdoc }
     */
    public function providerOptionalFields(): array
    {
        $data = parent::providerOptionalFields();
        $data[] = ['signed:meta:targets.json:length', 999];
        $data[] = ['signed:meta:targets.json:hashes', ['sha256' => 'some long hash']];
        return static::getKeyedArray($data);
    }

    /**
     * Data provider for testUntrustedException().
     *
     * @return string[]
     *   The test cases for testUntrustedException().
     */
    public function providerUntrustedException(): array
    {
        $mockMetadata = $this->createMock(MetadataBase::class);
        return self::getKeyedArray([
            ['getFileMetaInfo', ['any-key']],
        ]);
    }
}

Filemanager

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
Filemanager