[limb-issues] Resolved: (TR-2) I get "PHP Fatal error: Cannot redeclare class" since SimpleTest :: TestCase uses include instead of include_once

Pavel Shevaev (JIRA) jira at limb-project.com
Tue Oct 31 11:17:32 MSK 2006


     [ http://jira.limb-project.com/browse/TR-2?page=all ]

Pavel Shevaev resolved TR-2.
----------------------------

    Resolution: Won't Fix

> I get "PHP Fatal error:  Cannot redeclare class" since SimpleTest :: TestCase uses include instead of include_once
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: TR-2
>                 URL: http://jira.limb-project.com/browse/TR-2
>             Project: TESTS_RUNNER
>          Issue Type: Bug
>         Environment: PHP 5.1.4, SimpleTest bundled with TEST_RUNNER
>            Reporter: Sergey Yudin
>         Assigned To: Pavel Shevaev
>
> I get "PHP Fatal error:  Cannot redeclare class" in the following situation:
> I have 3 files named MyTest.class.php, test1.test.php, test2.test.php.  The files are stored  in the same directory. 
> Here is the content of these files:
> MyTest.class.php:
> <?php
> require_once(dirname(__FILE__) . '/test2.test.php');
> class MyTest extends MyGenericTest2{}
> ?>
> test2.test.php
> <?php
> require_once(dirname(__FILE__) . '/test1.test.php');
> class MyGenericTest2 extends MyGenericTest1{}
> ?>
> test1.test.php,
> <?php
> class MyGenericTest1 extends UnitTestCase{}
> ?>
> The problem is with SimpleTest that uses "include" operator instead of "include_once" in TestCase :: _requireWithError. If I change to include_once - the problem is solved. Should we mail to SimpleTest dev mail list??

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.limb-project.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the limb-issues mailing list