__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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\TimestampMetadata;

/**
 * @coversDefaultClass \Tuf\Metadata\TimestampMetadata
 */
class TimestampMetadataTest extends MetadataBaseTest
{
    use UntrustedExceptionTrait;

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

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

    /**
     * {@inheritdoc}
     */
    protected static function callCreateFromJson(string $json): MetadataBase
    {
        return TimestampMetadata::createFromJson($json);
    }

    /**
     * {@inheritdoc }
     */
    public function providerOptionalFields(): array
    {
        $data = parent::providerOptionalFields();
        $data[] = ['signed:meta:snapshot.json:length', 999];
        return static::getKeyedArray($data);
    }

    /**
     * {@inheritdoc}
     */
    public function providerExpectedField(): array
    {
        $data = parent::providerExpectedField();
        $data[] = ['signed:meta'];
        $data[] = ['signed:meta:snapshot.json', 'This collection should contain 1 element or more.'];
        $data[] = ['signed:meta:snapshot.json:version'];
        $data[] = ['signed:meta:snapshot.json:hashes'];
        return $data;
    }

    /**
     * {@inheritdoc}
     */
    public function providerValidField(): array
    {
        $data = parent::providerValidField();
        $data[] = ['signed:meta', 'array'];
        $data[] = ['signed:meta:snapshot.json', 'array'];
        $data[] = ['signed:meta:snapshot.json:version', 'int'];
        $data[] = ['signed:meta:snapshot.json:length', 'int'];
        $data[] = ['signed:meta:snapshot.json:hashes', 'array'];
        $data[] = ['signed:meta:snapshot.json:hashes:sha256', 'string'];
        $data[] = ['signed:meta:snapshot.json:hashes:sha512', 'string'];
        return $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