Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

A bug of using class autoloader for selenium browser test #631

Closed
TriAnMan opened this Issue · 0 comments

2 participants

@TriAnMan

I've found that PHPUnit 3.6.12 throws an php warning while executing a selenium test suite with multiple configured browsers (in xml or in test class). You can see a lot of people facing this issue: http://www.yiiframework.com/forum/index.php/topic/30511-firefoxphp-faild-to-include-in-yiibase/
To replicate a bug you have to install Yii framework 1.1.12, create a webapp with yiic, configure (change TEST_BASE_URL in WebTestCase.php) and launch tests in protected/tests folder.

I've made a patch fixing this problem, so could you apply it in the next release of PHPUnit.

From 6967a195ce5407504d9c592bbdd4c9419daf4050 Mon Sep 17 00:00:00 2001
From: Anton Andersen
Date: Mon, 3 Sep 2012 01:46:44 +0400
Subject: [PATCH] fixed autoloading of classes

---
 PHPUnit/Framework/TestSuite.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PHPUnit/Framework/TestSuite.php b/PHPUnit/Framework/TestSuite.php
index 7477af5..af6b195 100644
--- a/PHPUnit/Framework/TestSuite.php
+++ b/PHPUnit/Framework/TestSuite.php
@@ -651,6 +651,7 @@ public function run(PHPUnit_Framework_TestResult $result = NULL, $filter = FALSE
                 $this->setUp();

                 if ($this->testCase &&
+                    class_exists($this->name, false) &&
                     method_exists($this->name, 'setUpBeforeClass')) {
                     call_user_func(array($this->name, 'setUpBeforeClass'));
                 }
@@ -749,6 +750,7 @@ public function run(PHPUnit_Framework_TestResult $result = NULL, $filter = FALSE

         if ($doSetup) {
             if ($this->testCase &&
+                class_exists($this->name, false) &&
                 method_exists($this->name, 'tearDownAfterClass')) {
                 call_user_func(array($this->name, 'tearDownAfterClass'));
             }
-- 
1.7.11.msysgit.0
@edorian edorian closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.