Re: PEAR_Info TestSuite with PHPUnit 3.1.x

From: Date: Sat, 28 Jul 2007 18:19:28 +0000
Subject: Re: PEAR_Info TestSuite with PHPUnit 3.1.x
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-47717@lists.php.net to get a copy of this message
Sebastian Bergmann a écrit :
Laurent Laville schrieb:
When we run phpunit on command line, PHPUnit/TextUI/Command.php, load itself some class file that will use PEAR/Config.
PEAR_Config is only loaded in special cases, for instance when a specified test file is not found and needs to be searched in the test_dir path.
Hello Sebastian, Of course PEAR_Config is only loaded when PHPUnit need it, but the problem, at least I have is : - then we have "PEAR/Config.php" file loaded by require_once php function, then there are no more possibility to reload the class again with others configuration (see constants list in top of file). - my problem was to load PEAR/Config with setting corresponding to PHP_PEAR_SYSCONF_DIR env variable - but I still have PEAR/Config with default 'SystemRoot' env var corresponding to first load made by PHPUnit with 'PHPUnit\Util\Fileloader.php' Hope my problem and its explains are better now regards Laurent Here are a little script to see what libraries loaded by PHPUnit and where PEAR/Config is called <?php class Tests {
    public static function main()
    {
        $includes = get_included_files();
        $find = 'PEAR/Config.php';
        foreach ($includes as $f) {
            $s = file_get_contents($f);
            print "searching into $f \n";
            if (strpos($s, $find)) {
               print "\t$find implement into file $f \n";
            }
        }
    }
} Tests::main(); ?> First implement is false , due to text string found in blacklistedfilters. So First real call is second implement in list below phpunit Tests Tests.php, gave us these results (on my windows platform) : searching into C:\wamp\php\PEAR\PHPUnit\TextUI\Command.php searching into C:\wamp\php\PEAR\PHPUnit\TextUI\TestRunner.php searching into C:\wamp\php\PEAR\PHPUnit\Framework.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Filter.php
    PEAR/Config.php implement into file C:\wamp\php\PEAR\PHPUnit\Util\Filter.php
searching into C:\wamp\php\PEAR\PHPUnit\Framework\SelfDescribing.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\AssertionFailedError.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Assert.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Type.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Error.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Notice.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\IncompleteTest.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\SkippedTest.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Test.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\TestFailure.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\TestListener.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\TestResult.php searching into C:\wamp\php\PEAR\PHPUnit\Util\ErrorHandler.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Printer.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Test.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Timer.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\ExpectationFailedException.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\IncompleteTestError.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\SkippedTestError.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\SkippedTestSuiteError.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\TestCase.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Mock.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Matcher.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Matcher\Invocation.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Invocation.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Verifiable.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Matcher\InvokedRecorder.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Matcher\AnyParameters.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Matcher\StatelessInvocation.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Matcher\InvokedAtIndex.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Matcher\InvokedAtLeastOnce.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Matcher\InvokedCount.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Matcher\MethodName.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Matcher\Parameters.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\MockObject.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Builder\MethodNameMatch.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Builder\ParametersMatch.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Builder\Match.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Builder\Stub.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Builder\Identity.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\InvocationMocker.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Builder\InvocationMocker.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Stub.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Stub\Exception.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Stub\MatcherCollection.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Stub\Return.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Builder\Namespace.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\MockObject\Invokable.php searching into C:\wamp\php\PEAR\PHPUnit\Runner\BaseTestRunner.php searching into C:\wamp\php\PEAR\PHPUnit\Runner\StandardTestSuiteLoader.php searching into C:\wamp\php\PEAR\PHPUnit\Runner\TestSuiteLoader.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Fileloader.php
    PEAR/Config.php implement into file C:\wamp\php\PEAR\PHPUnit\Util\Fileloader.php
searching into C:\wamp\php\PEAR\PHPUnit\Framework\TestSuite.php searching into C:\wamp\php\PEAR\PHPUnit\Extensions\PhptTestCase.php searching into C:\wamp\php\PEAR\PHPUnit\Extensions\PhptTestCase\Logger.php searching into C:\wamp\php\PEAR\PEAR\RunTest.php
    PEAR/Config.php implement into file C:\wamp\php\PEAR\PEAR\RunTest.php
searching into C:\wamp\php\PEAR\PEAR.php searching into C:\wamp\php\PEAR\PEAR\Config.php searching into C:\wamp\php\PEAR\PEAR\Registry.php searching into C:\wamp\php\PEAR\PEAR\DependencyDB.php
    PEAR/Config.php implement into file C:\wamp\php\PEAR\PEAR\DependencyDB.php
searching into C:\wamp\php\PEAR\PEAR\Installer\Role.php searching into C:\wamp\php\PEAR\PEAR\Installer\Role\Common.php searching into C:\wamp\php\PEAR\PEAR\XMLParser.php searching into C:\wamp\php\PEAR\System.php searching into C:\wamp\php\PEAR\Console\Getopt.php searching into C:\wamp\php\PEAR\PEAR\Remote.php
    PEAR/Config.php implement into file C:\wamp\php\PEAR\PEAR\Remote.php
searching into C:\wamp\php\PEAR\PHPUnit\Util\Class.php searching into C:\wamp\php\PEAR\PHPUnit\Util\TestSuiteIterator.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Warning.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\And.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\ArrayHasKey.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\Attribute.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\ClassHasAttribute.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\ClassHasStaticAttribute.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\FileExists.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\GreaterThan.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\IsAnything.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\IsEqual.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Array.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\IsIdentical.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\IsInstanceOf.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\IsType.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\LessThan.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\Not.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\ObjectHasAttribute.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\Or.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\PCREMatch.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\StringContains.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\TraversableContains.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\TraversableContainsOnly.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\Constraint\Xor.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\ComparisonFailure.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\ComparisonFailure\Array.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\ComparisonFailure\Object.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\ComparisonFailure\Scalar.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\ComparisonFailure\String.php searching into C:\wamp\php\PEAR\PHPUnit\Framework\ComparisonFailure\Type.php searching into C:\wamp\php\PEAR\PHPUnit\Extensions\RepeatedTest.php searching into C:\wamp\php\PEAR\PHPUnit\Extensions\TestDecorator.php searching into C:\wamp\php\PEAR\PHPUnit\Runner\Version.php searching into C:\wamp\php\PEAR\PHPUnit\TextUI\ResultPrinter.php searching into C:\wamp\php\PEAR\PHPUnit\Util\TestDox\ResultPrinter.php searching into C:\wamp\php\PEAR\PHPUnit\Util\TestDox\NamePrettifier.php searching into C:\wamp\php\PEAR\PHPUnit\Util\TestDox\ResultPrinter\HTML.php searching into C:\wamp\php\PEAR\PHPUnit\Util\TestDox\ResultPrinter\Text.php searching into C:\wamp\php\PEAR\PHPUnit\Util\PDO.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Report.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Report\Coverage\Factory.php searching into C:\wamp\php\PEAR\PHPUnit\Util\CodeCoverage.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Report\Coverage\Node\Directory.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Filesystem.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Template.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Report\Coverage\Node.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Report\Coverage\Node\File.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Report\Test\Node\TestSuite.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Report\Test\Node.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Report\Test\Node\Test.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Report\Test\Factory.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Report\GraphViz.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Log\CodeCoverage\Database.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Log\CodeCoverage\XML.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Log\Database.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Log\GraphViz.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Log\JSON.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Log\TAP.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Log\XML.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Getopt.php searching into C:\wamp\php\PEAR\PHPUnit\Util\Skeleton.php searching into C:\wamp\www\PEAR_Info\tests\AllT.php
    PEAR/Config.php implement into file C:\wamp\www\PEAR_Info\tests\AllT.php
PHPUnit 3.1.4 by Sebastian Bergmann. F Time: 0 seconds There was 1 failure: 1) Warning(PHPUnit_Framework_Warning) No tests found in class "AllTests". FAILURES! Tests: 1, Failures: 1.

« previous php.pear.dev (#47717) next »