Skip to content

Run all methods including setUp, __constructor, ... #459

@ondrejkrajcik-blogic

Description

@ondrejkrajcik-blogic

Hi,

I create first test

When I run my test phpunit run all methods including setUp, __constructor and others

When I downgrade phpunit/phpunit from 9.6.8 to 9.3.11 then only methods with prefix "tests" are started.

Is there some incompatibility?

<?php

use PHPUnit\Extensions\Selenium2TestCase;

require_once __DIR__ . '/../bootstrap.php';

class ExampleTest extends Selenium2TestCase
{
    public $browser = 'firefox';

    protected function setUp(): void
    {
        $this->setBrowser($this->browser);
        $this->setBrowserUrl('http://jmather.com/');
    }

    public function testTitle()
    {
        $this->url('/');
        $title = "It's Majax";
        $this->assertEquals($title, $this->title());
    }

    public function testSomeNavigation()
    {
        $this->url('/');
        $this->byXPath('//section[@class="widget widget_categories"]//a[text() = "PHP"]')->click();
        $title = "PHP | It's Majax";
        $this->assertEquals($title, $this->title());
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions