X
X
xKapu2014-04-17 15:14:19
phpstorm
xKapu, 2014-04-17 15:14:19

How to solve problems with running tests (PHPUnit, Selenium, PHPStrom)?

Installed PEAR and PHPUnit, set preferences to PHPStorm. When running minimally simple tests, it gives an error

"C:\Program Files (x86)\php\php.exe" Z:\home\192.168\ib\Test\First.php
PHP Fatal error:  Class 'PHPUnit_Extensions_Selenium2TestCase' not found in Z:\home\192.168\ib\Test\First.php on line 4

Fatal error: Class 'PHPUnit_Extensions_Selenium2TestCase' not found in Z:\home\192.168\ib\Test\First.php on line 4

Process finished with exit code 255

Class code:
<?php

class WebTest extends PHPUnit_Extensions_Selenium2TestCase
{
    protected function setUp()
    {
        $this->setBrowser('firefox');
        $this->setBrowserUrl('http://www.example.com/');
    }

    public function testTitle()
    {
        $this->url('http://www.example.com/');
        $this->assertEquals('Example WWW Page', $this->title());
    }

}
?>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
gro, 2014-04-17
@gro

Because it is not necessary to call the file directly, but through phpunit test.php

V
Vit, 2014-04-17
@fornit1917

On PHPUnit, you still need to roll up an extension for Selenium.
pear install phpunit/PHPUnit_Selenium

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question