PHP libraries that makes Selenium WebDriver + PHPUnit functional testing easy and robust

Overview

Steward: easy and robust testing with Selenium WebDriver + PHPUnit

Latest Stable Version GitHub Actions Build Status AppVeyor Build Status Coverage Status Total Downloads

Steward is a set of libraries made to simplify writing and running robust functional system tests in PHPUnit using Selenium WebDriver.

What's great about Steward?

  • It allows you to start writing complex test cases in a minute.
  • It performs a lot of work for you:
    • downloads and installs Selenium server with one command
    • sets-up browser of your choice
    • automatically takes a screenshot on failed assertions
    • produces test results in JUnit format (easily processable, for example, by Jenkins and other tools)
    • and more...
  • Tests are run in parallel, so the only bottleneck is the number of Selenium nodes you start simultaneously.
  • Simple syntax sugar layer on top of default WebDriver commands helps shorten your tests and improve readability.
  • If you already use PHP, you don't have to learn a new language to write functional tests. Moreover, if you are familiar with unit tests and PHPUnit, you know it all.
  • Allows you to plan test dependencies.
    • For example, if you need to wait 2 minutes until some event gets through your message queue before testing the result? No problem! The order of tests is optimized to minimize the total execution time.
  • Status of tests can be clearly watched during test execution, so you will easily know how many tests have finished and what their results are.
  • You can extend Steward easily by registering custom events to EventDispatcher.
    • For example if you can add custom configuration options or change parameters passed to child PHPUnit processes.
  • Cloud services like Sauce Labs, BrowserStack or TestingBot are fully integrated giving you a chance to run tests with less setup and without your own infrastructure.
  • Steward is field tested - we use it daily in our company to maintain the quality of our products thanks to hundreds of test-cases. The library itself is also extensively covered by unit tests.
  • Steward is built on solid foundations: WebDriver is W3C draft standard for browser automation, php-webdriver is the most used and developed Selenium language binding for PHP, PHPUnit is a well known and widely used testing framework, and Symfony Console is industry standard for PHP CLI applications.

Example usage

To see how to use and extend Steward, have a look at our example project.

Changelog

For the latest changes see the CHANGELOG.md file. We follow Semantic Versioning.

Getting started

1. Install Steward

For most cases we recommend having functional tests in the same repository as your application but in a separate folder. We suggest putting them in a selenium-tests/ directory.

In this directory, simply install Steward with the following command:

$ composer require lmc/steward

Note: you will need to have Composer installed to do this.

2. Download Selenium Server and browser drivers

The following step only applies if you want to download and run Selenium Standalone Server with the test browser locally right on your computer. Another possibility is to start Selenium Server and test browser inside a Docker container.

Get Selenium Standalone Server

You need to download Selenium server so it can execute commands in the specified browser. In the root directory of your tests (e.g. selenium-tests/) simply run:

$ ./vendor/bin/steward install

This will check for the latest version of Selenium Standalone Server and download it for you (the jar file will be placed into the ./vendor/bin directory).

You may want to run this command as part of your CI server build, then simply use the --no-interaction option to download Selenium without any interaction and print the absolute path to the jar file as the sole output.

Download browser drivers

If it is not already installed on your system, you will need to download Selenium driver for the browser(s) you want to use for the tests. See Selenium server & browser drivers in our wiki for more information.

3. Write the first test

To provide you with Steward functionality, your tests have to extend the Lmc\Steward\Test\AbstractTestCase class.

You must also configure PSR-4 autoloading so that your tests could be found by Steward. It is as easy as adding the following to your composer.json file:

    "autoload": {
        "psr-4": {
            "My\\": "tests/"
        }
    }

Don't forget to create the selenium-tests/tests/ directory and to run composer dump-autoload afterwards.

For the test itself, place it in the selenium-tests/tests/ directory:

wd->get('https://www.w3.org/'); // $this->wd holds instance of \RemoteWebDriver // Do some assertion $this->assertContains('W3C', $this->wd->getTitle()); // You can use $this->log(), $this->warn() or $this->debug() with sprintf-like syntax $this->log('Current page "%s" has title "%s"', $this->wd->getCurrentURL(), $this->wd->getTitle()); // Make sure search input is present $searchInput = $this->wd->findElement(WebDriverBy::cssSelector('#search-form input')); // Or you can use syntax sugar provided by Steward (this is equivalent of previous line) $searchInput = $this->findByCss('#search-form input'); // Assert title of the search input $this->assertEquals('Search', $searchInput->getAttribute('title')); } } ">

// selenium-tests/tests/TitlePageTest.php

namespace My; // Note the "My" namespace maps to the "tests" folder, as defined in the autoload part of `composer.json`.

use Facebook\WebDriver\WebDriverBy;
use Lmc\Steward\Test\AbstractTestCase;

class TitlePageTest extends AbstractTestCase
{
    public function testShouldContainSearchInput()
    {
        // Load the URL (will wait until page is loaded)
        $this->wd->get('https://www.w3.org/'); // $this->wd holds instance of \RemoteWebDriver

        // Do some assertion
        $this->assertContains('W3C', $this->wd->getTitle());

        // You can use $this->log(), $this->warn() or $this->debug() with sprintf-like syntax
        $this->log('Current page "%s" has title "%s"', $this->wd->getCurrentURL(), $this->wd->getTitle());

        // Make sure search input is present
        $searchInput = $this->wd->findElement(WebDriverBy::cssSelector('#search-form input'));
        // Or you can use syntax sugar provided by Steward (this is equivalent of previous line)
        $searchInput = $this->findByCss('#search-form input');

        // Assert title of the search input
        $this->assertEquals('Search', $searchInput->getAttribute('title'));
    }
}

4. Run your tests

Start Selenium server

Now you need to start Selenium server, which will listen for and execute commands sent from your tests.

$ java -jar ./vendor/bin/selenium-server-standalone-3.4.0.jar # the version may differ

This will start a single Selenium Server instance (listening on port 4444) in "no-grid" mode (meaning the server receives and executes the commands itself).

Note: You may want to run Selenium Server in a grid mode. This has the hub receiving commands while multiple nodes execute them. Consult --help and the -role option of Selenium server.

Run Steward!

Now that Selenium Server is listening, let's launch your test! Use the run command:

./vendor/bin/steward run staging firefox

In a few moments you should see a Firefox window appear, then the https://www.w3.org/ site (as defined in the example tests) should be loaded before the window instantly closes. See the output of the command to check the test result.

The run command has two required arguments: the name of the environment and the browser:

  • The environment argument has no effect by default, but is accessible in your tests making it easy to, for example, change the base URL of your tested site. This would be useful for testing between your local server and staging environments
  • The browser name could be any browser name supported by Selenium. Most common are "firefox", "chrome", "phantomjs", "safari" and "internet explorer". See our wiki for more info related to installing browser drivers.

There is also a bunch of useful options for the run command:

  • --group - only run specific group(s) of tests
  • --exclude-group - exclude some group(s) of tests (can be even combined with --group)
  • --server-url - set different url of selenium server than the default (which is http://localhost:4444/wd/hub)
  • --xdebug - start Xdebug debugger on your tests. Allows you to debug tests from your IDE (learn more about tests debugging in our Wiki)
  • --capability - directly pass any extra capability to the Selenium WebDriver server (see wiki for more information and examples)
  • --parallel-limit - limit number of testcases being executed in a parallel (default is 50)
  • --help - see all other options and default values
  • adjust output levels: by default, only the test results summary is printed to the output; the verbosity could be changed by the following:
    • -v - to instantly output name of failed test(s)
    • -vv - also print progress information during run (which tests were started/finished etc); if any test fails, its output will by printed to the console
    • -vvv - output everything, including all output from the tests

5. See the results and screenshots

The log is printed to the console where you run the run command. This could be a bit confusing, especially if you run multiple tests in parallel.

As a solution, for each testcase there is a separate file in JUnit XML format, placed in logs/ directory. Screenshots and HTML snapshots are also saved into this directory (they are automatically generated on failed assertion or if a WebDriver command fails).

To see the current status of tests during (or after) test execution, open the logs/results.xml file in your browser:

Example output as displayed in logs/results.xml file

Similar output in the command line interface can be obtained using the ./vendor/bin/steward results command (see below). You can also add -vvv to see results of each individual test.

Example output of results command

6. See test execution timeline

Steward provides a visual representation of the test execution timeline. When used with Selenium Server in "grid" mode you can see which Selenium node executed which testcase, identify possible bottlenecks and so on.

To generate the timeline, simply run the generate-timeline command after your test build is finished:

./vendor/bin/steward generate-timeline

File timeline.html will then be generated into the logs/ directory.

Example timeline visualization

License

Steward is open source software licensed under the MIT license.

Comments
  • Looks like url

    Looks like url "http://localhost:4444" is occupied by something else than Selenium server.

    Hi guys

    I have setup selenium server with docker and follow you're Start Selenium server + browser inside Docker description, everything is ok on my local ubuntu, but when I set up in my server selenium is startup very well but when run tests i got this error: " Looks like url "http://localhost:4444" is occupied by something else than Selenium server. Make sure Selenium server is really accessible on this url or change it using --server-url option"

    Also, i try another answer in another issue, but they don't work

    needs more info 
    opened by ghost 15
  • Using remote browser stack isn't working

    Using remote browser stack isn't working

    Using this sweet with browser stack is working. I get this error

    [ERROR] Looks like url "https://mycreds:[email protected]:80/wd/hub" is occupied by something else than Selenium server. Make sure Selenium server is really accessible on this url or change it using --server-url option

    The tests pass when not using this suite and just using a simple selenium script both on php and nodejs. so the issue must be with the implimentation for steward

    opened by dking3876 12
  • Chrome tests wont' work

    Chrome tests wont' work

    i am unable to get any test to perform on chrome. using firefox everything works fine. when switching to use chrome it does not

    <?php namespace My; // Note the "My" namespace maps to the "tests" folder, as defined in the autoload part ofcomposer.json`.

    use Facebook\WebDriver\WebDriverBy; use Facebook\WebDriver\WebDriverExpectedCondition; use Lmc\Steward\Test\AbstractTestCase;

    class TitlePageTest extends AbstractTestCase { protected $url = "http://design.brafton.com/escoffier/"; public function testDoesNotHaveWordpressInTitle() { // Load the URL (will wait until page is loaded) $this->wd->get($this->url); // $this->wd holds instance of \RemoteWebDriver

        // Do some assertion
        // $this->assertContains('W3C', $this->wd->getTitle());
    
        // You can use $this->log(), $this->warn() or $this->debug() with sprintf-like syntax
        $this->log('Current page "%s" has title "%s"', $this->wd->getCurrentURL(), $this->wd->getTitle());
    
        // // Make sure search input is present
        // $searchInput = $this->wd->findElement(WebDriverBy::cssSelector('#search-form input'));
        // Or you can use syntax sugar provided by Steward (this is equivalent of previous line)
        // $searchInput = $this->findByCss('#search-form input');
    
        // Assert title of the search input
        $this->assertNotContains($this->wd->getTitle(), ['wordpress', 'WordPress', 'Wordpress']);
    }
    public function testSearchForDog(){
        $this->wd->get($this->url);
    
        $input = $this->wd->findElement(WebDriverBy::cssSelector('input[name=s]'))->sendKeys("Dog");
        
        $this->wd->findElement(WebDriverBy::id('searchsubmit'))->click();
        $body = $this->wd->wait(10)->until(
            WebDriverExpectedCondition::presenceOfAllElementsLocatedBy(
                WebDriverBy::className('search-results')
            )
        );
        var_dump($body);
        $this->assertEquals('body',$body[0]->getTagName());
    }
    

    }`

    needs more info 
    opened by dking3876 12
  • Can't figure out instructions

    Can't figure out instructions

    I've tried the getting started instructions and i'm hitting a wall. I'm able to run a test. I actually had to install geckodriver to make it load firefox and then I end up getting this error message

    1) My\TitlePageTest::testShouldContainSearchInput My\TitlePageTest> Error: Class 'WebDriverBy' not found

    Here is my composer.json

    {
        "require": {
            "lmc/steward": "^2.1"
        },
        "autoload-dev": {
            "psr-4": {
                "My\\": "tests/",
                "" : "tests/"
            }
        }
    }
    

    What am I doing wrong?

    opened by sherylroberts 12
  • Support SauceLabs and BrowserStack cloud services

    Support SauceLabs and BrowserStack cloud services

    Few improvements in Steward to simplify support of Selenium cloud services (eg. automatic build number detection, port detection etc.).

    Also automatic publishing of results to SauceLabs API (to make the test results available on SauceLabs Dashboard) was added.

    As part of the changes option to pass any capability to the Selenium Server was added (using --capability=foo:bar option of run command)

    enhancement 
    opened by OndraM 10
  • Example repository with real tests

    Example repository with real tests

    We should prepare example repository with real tests, that will:

    • [x] ~~Describe how to begin writing tests using Steward (set-up, composer etc.)~~ Covered in getting started
    • [x] Show features and extensibility of AbstractTestCase
    • [x] Include custom component extending AbstractComponent and using PageObject design pattern
    • [ ] ~~Include custom EventListener extending Steward with custom option~~ moved to https://github.com/lmc-eu/steward-example/issues/13
    • [x] Be run periodically on Travis CI in Phantomjs
    • [x] Be run periodically on Travis CI in Firefox (nice to have)
    • [x] Add note about the example project to the main README
    enhancement 
    opened by OndraM 10
  • Possibility to run test one by one (not in a parallel)

    Possibility to run test one by one (not in a parallel)

    Currently the default processing of test executes all test in parallel. This is great, although we have built up a large test structure with multiple files with many tests. With the default setup instructions we would have many browsers open as we tend to use the @group. Is it possible to run a tests one after another or end to end? Many tests are located in different files. Is there a variable or capability option you can pass to have max amount of sessions at once?

    I don't see any mention of Selenium Grid or a maxSession option. Would the DelayStrategy be used?

    enhancement 
    opened by dahinton11 7
  • Results command to show test results summary from CLI

    Results command to show test results summary from CLI

    This is CLI equivalent to viewing results.xml file in a browser. Similarly this new steward results command could be used either when the run command is still in progress or when it is finished.

    It supports both verbosity modes - default, showing only testcases, and debug (-vvv) showing both testcases and tests.

    Screenshots (from the steward-example project):

    Default non-verbose mode

    screenshot_20160430_005255

    Verbose mode

    screenshot_20160430_005453

    Verbose mode during run

    screenshot_20160430_005541

    enhancement 
    opened by OndraM 7
  • Steward binary is called just

    Steward binary is called just "steward" for better portability

    On Windows Composer creates a .bat file for the binary. If the binary is called steward.php, Windows binary becames steward.php.bat, therefore launching steward.php does not work. On the other hand, if the binary is called just steward (should work fine on Linux), .bat is appended on Windows and launching steward launches that bat file.

    PHPUnit uses same convention: https://github.com/sebastianbergmann/phpunit

    //Note: It is possible BC break

    Closes #21

    opened by mhujer 7
  • Fix run option --logs-dir

    Fix run option --logs-dir

    run allow to specify a custom logs dir but this directory is not taken into account when running phpunit afterward.

    This is useful when you don't have write access to the directory where tests are defined & run

    bug 
    opened by vaceletm 6
  • Any way to resolve this composer conflict?

    Any way to resolve this composer conflict?

    Steward requires symfony/event-dispatcher:~3.0 but we're using Omnipay a pretty widely used payment lib as well and it requires guzzle/guzzle and guzzle again requires symfony/event-dispatcher 2.8.

    I'm aware this is not really a problem of Steward but I don't know how to resolve this conflict. :(

    Any advice? Is 3.0 really needed?

    λ composer require lmc/steward
    Using version ^2.1 for lmc/steward
    ./composer.json has been updated
    Loading composer repositories with package information                                     Updating dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Conclusion: don't install lmc/steward 2.1.0
        - Conclusion: remove symfony/event-dispatcher v2.8.20
        - Installation request for lmc/steward ^2.1 -> satisfiable by lmc/steward[2.1.0, 2.2.x-dev].
        - Conclusion: don't install symfony/event-dispatcher v2.8.20
        - lmc/steward 2.2.x-dev requires symfony/event-dispatcher ~3.0 -> satisfiable by symfony/event-dispatcher[3.0.x-dev, 3.1.x-dev, 3.2.x-dev, 3.3.x-dev, v3.0.0, v3.0.0-BETA1, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.0.7, v3.0.8, v3.0.9, v3.1.0, v3.1.0-BETA1, v3.1.0-RC1, v3.1.1, v3.1.10, v3.1.2, v3.1.3, v3.1.4, v3.1.5, v3.1.6, v3.1.7, v3.1.8, v3.1.9, v3.2.0, v3.2.0-BETA1, v3.2.0-RC1, v3.2.0-RC2, v3.2.1, v3.2.2, v3.2.3, v3.2.4, v3.2.5, v3.2.6, v3.2.7, v3.2.8, v3.3.0-BETA1].
        - Can only install one of: symfony/event-dispatcher[3.0.x-dev, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[3.1.x-dev, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[3.2.x-dev, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[3.3.x-dev, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.0.0, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.0.0-BETA1, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.0.1, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.0.2, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.0.3, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.0.4, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.0.5, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.0.6, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.0.7, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.0.8, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.0.9, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.1.0, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.1.0-BETA1, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.1.0-RC1, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.1.1, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.1.10, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.1.2, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.1.3, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.1.4, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.1.5, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.1.6, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.1.7, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.1.8, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.1.9, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.2.0, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.2.0-BETA1, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.2.0-RC1, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.2.0-RC2, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.2.1, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.2.2, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.2.3, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.2.4, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.2.5, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.2.6, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.2.7, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.2.8, v2.8.20].
        - Can only install one of: symfony/event-dispatcher[v3.3.0-BETA1, v2.8.20].
        - Installation request for symfony/event-dispatcher (locked at v2.8.20) -> satisfiable by symfony/event-dispatcher[v2.8.20].
    
    
    Installation failed, reverting ./composer.json to its original content.
    
    opened by burzum 6
  • Steward use phpunit ^8.5.15 what is with phpunit 9.x

    Steward use phpunit ^8.5.15 what is with phpunit 9.x

    I use cake php and i want to install steward for my test environment. But steward use phpunit 8.5. but i have installed phpunit 9.3 that i need it for other things.

    log of my composer

    Problem 1 - lmc/steward 3.0.x-dev is an alias of lmc/steward dev-master and thus requires it to be installed too. - lmc/steward 3.0.x-dev is an alias of lmc/steward dev-main and thus requires it to be installed too. - lmc/steward dev-master requires php ^7.1 -> your php version (8.1.2) does not satisfy that requirement. - lmc/steward dev-main requires phpunit/phpunit ^8.5.15 -> found phpunit/phpunit[8.5.15, ..., 8.5.26] but it conflicts with your root composer.json require (^9.3). - Root composer.json requires lmc/steward 3.0.x-dev -> satisfiable by lmc/steward[3.0.x-dev (alias of dev-master)].

    opened by nicokaiser79 0
  • writing to console

    writing to console

    hello, i want to writer my own comments to console when some tests are running. i have tried the following methods: $this->log("a"), $this->warn("a"), $this->debug("a") i only see this when i chose -vvv in mode but then i get alot of junk output. i am running under -vv mode and want to output some text to console. also tried: echo, print, sprinf

    how can i write to console and / or to result file. thank you.

    opened by tomthedude 0
  • Support Database hosts

    Support Database hosts

    Our selenium tests are designed to run on an empty schema, with their own setup and tear down scripts (to ensure any data is reset in each run).

    We have over 100 tests and 5000 assertions, when running in parallel, the tests cause unique constraints / failures in the DB when two tests use the same table.

    Is it possible to pass through ENV variables to each node, to specify a separate DB hosts for each parallel stack.

    Or even better, spread the parallel tests to a docker swarm?

    opened by joesaunderson 1
  • Pass composite capabilities via CLI

    Pass composite capabilities via CLI

    Currently only key:walue capabilities could be passed via CLI argument. More composite capabilities could be done using custom capabilities resolver. But the overhead seems to be a bit large for usecases like starting headless browser #233 etc.

    So we may think about a format to pass even composite capabilities (like chromeOptions = { args = ['--headless']}} via CLI.

    enhancement 
    opened by OndraM 1
  • Display assertions in output

    Display assertions in output

    I like the generated log file but I am missing an overview of all assertions. I would like to see which one failed. Is there a function which does that or is this a feature request?

    opened by q-jack 1
Owner
LMC s.r.o.
We are operating two biggest Czech recruitment portals (www.jobs.cz & www.prace.cz) and providing B2B on-line recruitment solution Teamio.
LMC s.r.o.
Provides generic data providers for use with phpunit/phpunit.

data-provider Installation Run composer require --dev ergebnis/data-provider Usage This package provides the following generic data providers: Ergebni

null 25 Jan 2, 2023
Qase-phpunit - Qase TMS PHPUnit reporter.

Qase TMS PHPUnit reporter Publish results simple and easy. How to integrate composer require qase/phpunit-reporter Example of usage The PHPUnit report

Qase TMS 6 Nov 24, 2022
Mockery - Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library

Mockery Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its c

Mockery 10.3k Jan 1, 2023
:computer: Parallel testing for PHPUnit

ParaTest The objective of ParaTest is to support parallel testing in PHPUnit. Provided you have well-written PHPUnit tests, you can drop paratest in y

null 2k Dec 31, 2022
PHPUnit extension for database interaction testing.

This extension is no longer maintained DbUnit PHPUnit extension for database interaction testing. Installation Composer If you use Composer to manage

Sebastian Bergmann 224 Aug 20, 2022
Mock implementation of the Translation package, for testing with PHPUnit

PoP Translation - Mock Mock implementation of the Translation package, for testing with PHPUnit Install Via Composer composer require getpop/translati

PoP 1 Jan 13, 2022
The objective of ParaTest is to support parallel testing in PHPUnit

The objective of ParaTest is to support parallel testing in PHPUnit. Provided you have well-written PHPUnit tests, you can drop paratest in your project and start using it with no additional bootstrap or configurations!

null 2k Dec 31, 2022
Learn unit testing with PHPUnit.

PHPUnit Exercise Running PHPUnit ./vendor/bin/phpunit # with filter which tests to run ./vendor/bin/phpunit --filter <pattern> Running Pint ./vendor/

Nopal 2 Aug 23, 2022
SimpleTest is a framework for unit testing, web site testing and mock objects for PHP

SimpleTest SimpleTest is a framework for unit testing, web site testing and mock objects for PHP. Installation Downloads All downloads are stored on G

SimpleTest 147 Jun 20, 2022
TestDummy makes the process of preparing factories (dummy data) for your integration tests as easy as possible

TestDummy TestDummy makes the process of preparing factories (dummy data) for your integration tests as easy as possible. As easy as... Build a Post m

Laracasts 461 Sep 28, 2022
An effort to make testing PHP code as easy and fun as its JavaScript equivalent

An effort to make testing PHP code as easy and fun as its JavaScript equivalent when using the excellent Jasmine, from which syntax and general usage is shamelessly borrowed.

Johan Stenqvist 24 Apr 22, 2022
The most powerful and flexible mocking framework for PHPUnit / Codeception.

AspectMock AspectMock is not an ordinary PHP mocking framework. With the power of Aspect Oriented programming and the awesome Go-AOP library, AspectMo

Codeception Testing Framework 777 Dec 12, 2022
PHPStan PHPUnit extensions and rules

PHPStan PHPUnit extensions and rules PHPStan PHPUnit This extension provides following features: createMock(), getMockForAbstractClass() and getMockFr

PHPStan 359 Dec 28, 2022
Additional PHPUnit assertions and helper functions

Jasny PHPUnit extension Additional functionality for PHPUnit. Callback mock - assert that callback is called with correct arguments. Safe mocks - disa

Arnold Daniels 2 Jul 24, 2022
Essence is a very flexible BDD style assertion framework for PHP that fits into existing PHPUnit projects nicely

Essence 1.5.1 Essence is a very flexible BDD style assertion framework for PHP that fits into existing PHPUnit projects nicely. Installation composer

bound1ess 2 Apr 7, 2015
vfsStream is a stream wrapper for a virtual file system that may be helpful in unit tests to mock the real file system. It can be used with any unit test framework, like PHPUnit or SimpleTest.

vfsStream vfsStream is a stream wrapper for a virtual file system that may be helpful in unit tests to mock the real file system. It can be used with

null 1.4k Dec 23, 2022
Rector upgrades rules for PHPUnit

Rector Rules for PHPUnit See available PHPUnit rules Install composer require rector/rector-phpunit Use Sets To add a set to your config, use Rector\P

RectorPHP 34 Dec 27, 2022
Add mocking capabilities to Pest or PHPUnit

This repository contains the Pest Plugin Mock. The Mocking API can be used in regular PHPUnit projects. For that, you just have to run the following c

PEST 16 Dec 3, 2022