Source for file package-test.php
Documentation is available at package-test.php
* Ensure all components are correctly included.
* This checks the filesystem, and compares it to the components.php file, and the package2.xml
return substr($filename, 0 , -1 );
// Get array of functions on filesystem
$filesystem = scandir('Compat/Function/');
// Get array of tests on filesystem
$tests = scandir('tests/function/');
// Find any incomplete tests
$incompleteTests = array ();
foreach ($tests_org as $testfile) {
$testfilename = 'tests/function/' . $testfile;
$incompleteTests[] = $testfile;
// Get a list of files from the package2.xml
$xml->registerXPathNamespace ('pear', 'http://pear.php.net/dtd/package-2.0');
$xpath = '/pear:package/pear:contents/pear:dir[@name="/"]/pear:dir[@name="Compat"]/pear:dir[@name="Function"]/pear:file';
foreach ($xml->xpath ($xpath) as $file) {
$filexml[] = (string) $file['name'];
// Get a list of tests from the package2.xml
$xpath = '/pear:package/pear:contents/pear:dir[@name="/"]/pear:dir[@name="tests"]/pear:dir[@name="function"]/pear:file';
foreach ($xml->xpath ($xpath) as $file) {
$testxml[] = (string) $file['name'];
// Get list of files from Components.php
require 'Compat/Components.php';
foreach ($filecomps as $k => $comp) { $filecomps[$k] = $comp . '.php'; }
echo "Exists in filesystem but not in XML:\n";
echo '- ' . implode($res, ', ') . "\n";
echo "Incomplete test:\n";
echo '- ' . implode($res, ', ') . "\n";
echo "Exists in filesystem but not in tests XML:\n";
echo '- ' . implode($res, ', ') . "\n";
echo "Exists in filesystem but not in Components:\n";
echo '- ' . implode($res, ', ') . "\n";
echo "Exists in XML but not in Filesytem:\n";
echo '- ' . implode($res, ', ') . "\n";
echo "Tests not found for the following files:\n";
echo '- ' . implode($res, ', ') . "\n";
echo "No errors found\n";
Documentation generated on Mon, 11 Mar 2019 15:39:40 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|