PHP Classes

File: web/SSO/vendor/openid/php-openid/Tests/Auth/Yadis/TestUtil.php

Recommend this page to a friend!
  Classes of william amed   Raptor 2   web/SSO/vendor/openid/php-openid/Tests/Auth/Yadis/TestUtil.php   Download  
File: web/SSO/vendor/openid/php-openid/Tests/Auth/Yadis/TestUtil.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Raptor 2
Framework that takes routes from annotations
Author: By
Last change:
Date: 8 years ago
Size: 621 bytes
 

Contents

Class file image Download
<?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');
}