Page MenuHomeWickedGov Phorge

TestUtils.php
No OneTemporary

Size
683 B
Referenced Files
None
Subscribers
None

TestUtils.php

<?php
namespace Cite\Tests;
use Cite\ReferenceStackItem;
/**
* @license GPL-2.0-or-later
*/
class TestUtils {
/**
* Factory to create internal ref data structures from array fixtures.
*/
public static function refFromArray( ?array $val ): ?ReferenceStackItem {
if ( $val === null ) {
return null;
}
$ref = new ReferenceStackItem();
foreach ( $val as $k => $v ) {
$ref->{$k} = $v;
}
return $ref;
}
/**
* @return array<string,array<string|int,?ReferenceStackItem>>
*/
public static function refGroupsFromArray( array $refs ) {
return array_map(
fn ( $groupRefs ) => array_map( [ self::class, 'refFromArray' ], $groupRefs ),
$refs
);
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 3, 19:10 (1 d, 23 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d5/c2/9e42790ac449ec8a56c3aade667f
Default Alt Text
TestUtils.php (683 B)

Event Timeline