gnu-social/vendor/openid/php-openid/Tests/Auth/Yadis/TestUtil.php
Diogo Cordeiro 2a06261f75 [CORE][COMPOSER] Move extlib packages with immediate composer correspondent to composer dependencies
This adds a composer.json for all dependencies that are available
2019-08-03 17:47:24 +01:00

31 lines
621 B
PHP

<?php
/**
* Utilites for test functions
*/
function Tests_Auth_Yadis_datafile($name, $reader)
{
$path = dirname(realpath(__FILE__));
$sep = DIRECTORY_SEPARATOR;
$filename = $path . $sep . 'data' . $sep . $name;
$data = $reader($filename);
if ($data === false) {
$msg = "Failed to open data file: $name";
trigger_error($msg, E_USER_ERROR);
}
return $data;
}
function Tests_Auth_Yadis_readdata($name)
{
return Tests_Auth_Yadis_datafile($name, 'file_get_contents');
}
function Tests_Auth_Yadis_readlines($name)
{
return Tests_Auth_Yadis_datafile($name, 'file');
}