sebastianbergmann/phpunit-selenium — Issue #72: ReflectionException with  $seleneseDirectory
Author: Crabcz
Created: 2011-11-15 09:25:25+00:00
State: open

copied from:
@mhoareau84 wrote here https://github.com/sebastianbergmann/phpunit/issues/389 :

and I have the same behavior

I am trying to use a directory of Selenese/HTML files as tests with the property $seleneseDirectory,
as described here: http://www.phpunit.de/manual/3.6/en/selenium.html#selenium.seleniumtestcase.examples.WebTest4.php

Here my test:

setHost ( "127.0.0.1" );
$this->setPort ( 8888 );
$this->setBrowser ( "*safari" );
$this->setBrowserUrl ( "http://www.google.com/" );
$this->setTimeout ( 60000 );
}
}
When i run the following command line:

phpunit SeleneseTest.php
It is working correctly. But when i add the option for code coverage, i got the following error:

phpunit --coverage-html build/logs/coverage/ SeleneseTest.php
PHPUnit 3.5.15 by Sebastian Bergmann.
.
ReflectionException: Method SeleneseTest::selenium_ide/search.html() does not exist in /Users/user/pear/share/pear/PHP/CodeCoverage/Util.php on line 218
(search.html is my test case in html saved by selenium IDE)

Is that a bug ? Or did I miss something ?

----
I have the same issues, even without code coverage on:
I'm using phpunit 3.6.3
Here's my stack trace:

$ phpunit --debug --verbose --bootstrap _tests/phpUnit/bootstrap.php _tests/selenium/html/SeleneseTest.php
PHPUnit 3.6.3 by Sebastian Bergmann.

Starting test 'SeleneseTest::/data/test.htm'.
.exception 'ReflectionException' with message 'Method SeleneseTest::/data/test.htm() does not exist' in /usr/share/php/PHPUnit/Util/Test.php:264
Stack trace:
#0 /usr/share/php/PHPUnit/Util/Test.php(264): ReflectionMethod->__construct('SeleneseTest', '/data/dev/actum...')
#1 /usr/share/php/PHPUnit/Util/Test.php(370): PHPUnit_Util_Test::parseTestMethodAnnotations('SeleneseTest', '/data/test.htm...')
#2 /usr/share/php/PHPUnit/Util/Test.php(421): PHPUnit_Util_Test::getGroups('SeleneseTest', '/data/dev/actum...')
#3 /usr/share/php/PHPUnit/Framework/TestResult.php(390): PHPUnit_Util_Test::getSize('SeleneseTest', '/data/test.htm...')
#4 /usr/share/php/PHPUnit/Framework/TestResult.php(742): PHPUnit_Framework_TestResult->endTest(Object(SeleneseTest), 28.454544067383)
#5 /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php(527): PHPUnit_Framework_TestResult->run(Object(SeleneseTest))
#6 /usr/share/php/PHPUnit/Framework/TestSuite.php(772): PHPUnit_Extensions_SeleniumTestCase->run(Object(PHPUnit_Framework_TestResult))
#7 /usr/share/php/PHPUnit/Framework/TestSuite.php(745): PHPUnit_Framework_TestSuite->runTest(Object(SeleneseTest), Object(PHPUnit_Framework_TestResult))
#8 /usr/share/php/PHPUnit/TextUI/TestRunner.php(325): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult), false, Array, Array, false)
#9 /usr/share/php/PHPUnit/TextUI/Command.php(187): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#10 /usr/share/php/PHPUnit/TextUI/Command.php(125): PHPUnit_TextUI_Command->run(Array, true)
#11 /usr/bin/phpunit(44): PHPUnit_TextUI_Command::main()
#12 {main}