diff options
author | tailor <cygnus@janrain.com> | 2007-03-12 19:06:56 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2007-03-12 19:06:56 +0000 |
commit | 57ae1417c4a06d713370adee98e49df52bd2a67d (patch) | |
tree | 9639d2ba7313daa67cfd636f83ca73874a791387 /Tests/Auth/Yadis/TestUtil.php | |
parent | 338d0a3cc020328d349faff0c5d87a5ff6459f6e (diff) | |
download | php-openid-57ae1417c4a06d713370adee98e49df52bd2a67d.zip php-openid-57ae1417c4a06d713370adee98e49df52bd2a67d.tar.gz php-openid-57ae1417c4a06d713370adee98e49df52bd2a67d.tar.bz2 |
[project @ [1/2] Move Services/Yadis to Auth/]
Diffstat (limited to 'Tests/Auth/Yadis/TestUtil.php')
-rw-r--r-- | Tests/Auth/Yadis/TestUtil.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Tests/Auth/Yadis/TestUtil.php b/Tests/Auth/Yadis/TestUtil.php new file mode 100644 index 0000000..e6d7a57 --- /dev/null +++ b/Tests/Auth/Yadis/TestUtil.php @@ -0,0 +1,28 @@ +<?php + +/** + * Utilites for test functions + */ + +function Tests_Services_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_Services_Yadis_readdata($name) +{ + return Tests_Services_Yadis_datafile($name, 'file_get_contents'); +} + +function Tests_Services_Yadis_readlines($name) +{ + return Tests_Services_Yadis_datafile($name, 'file'); +} |