Hello,

I was reading unit tests from some recent components and I noticed most of
them include the following statement:

require_once dirname(dirname(dirname(__FILE__))) . '/TestHelper.php';
require_once "PHPUnit/Framework/TestCase.php";
require_once "PHPUnit/Framework/TestSuite.php";

I was wondering if is there any particular reason for including again
TestCase.php and TestSuite.php.
They appears to be already required by TestHelper.

Additionally, I noticed it's a common practice to include TestHelper only in
the AllTest.php file (main suite).
This makes impossibile to run a class specific unit test due to an error
trying to include Zend/* file not available in include_path.

Let me show you a few examples:

// the following statement works fine
phpunit --verbose Zend_Service_Yahoo_AllTests

// the following statements fail
//  Failed opening required 'Zend/*' ... 
phpunit --verbose Zend_Service_Yahoo_OfflineTest
phpunit --verbose Zend_OpenId_ConsumerTest

// the following statement fails for the same reason as above
phpunit --verbose Zend_OpenId_AllTests  

-- Simone
-- 
View this message in context: 
http://www.nabble.com/Multiple-%28and-perhaps-not-needed%29-require-statements-tp15299693s16154p15299693.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to