Файловый менеджер - Редактировать - /var/www/html/mediawiki-1.43.1/tests/phpunit/includes/utils/FileContentsHasherTest.php
Ðазад
<?php /** * @covers \FileContentsHasher */ class FileContentsHasherTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; public static function provideSingleFile() { return array_map( static function ( $file ) { return [ $file, file_get_contents( $file ) ]; }, glob( __DIR__ . '/../../data/filecontentshasher/*.*' ) ); } /** * @dataProvider provideSingleFile */ public function testSingleFileHash( $fileName, $contents ) { $expected = hash( 'md4', $contents ); $actualHash = FileContentsHasher::getFileContentsHash( $fileName ); $this->assertEquals( $expected, $actualHash ); $actualHashRepeat = FileContentsHasher::getFileContentsHash( $fileName ); $this->assertEquals( $expected, $actualHashRepeat ); } public function provideMultipleFiles() { return [ [ $this->provideSingleFile() ] ]; } /** * @dataProvider provideMultipleFiles */ public function testMultipleFileHash( $files ) { $fileNames = []; $hashes = []; foreach ( $files as [ $fileName, $contents ] ) { $fileNames[] = $fileName; $hashes[] = hash( 'md4', $contents ); } $expectedHash = hash( 'md4', implode( '', $hashes ) ); $actualHash = FileContentsHasher::getFileContentsHash( $fileNames ); $this->assertEquals( $expectedHash, $actualHash ); $actualHashRepeat = FileContentsHasher::getFileContentsHash( $fileNames ); $this->assertEquals( $expectedHash, $actualHashRepeat ); } }
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка