Giter VIP home page Giter VIP logo

phpunit-detailed-printer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

phpunit-detailed-printer's Issues

Result printer adds an extra ")" after printing "$this->testRow"

I am using this printer in windows console and the results prints as expected. I really wanted this. But the result adds an extra ) with every testrow printed.
capture

I solved it by adding \r to the writeProgress function where $this->write() is called.

protected function writeProgress($progress)
    {
        if ($this->hasReplacementSymbol($progress)) {
            $progress = static::$symbols[$progress];
        }

        $this->write("{$progress} {$this->testRow}\r");
        $this->column++;
        $this->numTestsRun++;
    }

Can you update the code in this repo? @insanesvk @hrcc

Add PHPUnit 9 support

Hi there,

I'm using this dependency and was wondering if there are plans for PHPUnit 9 support?
It looks like in PHPUnit 9 the PHPUnit\TextUI\ResultPrinter class has been converted into an interface (check sebastianbergmann/phpunit#4024) and there is now a PHPUnit\TextUI\DefaultResultPrinter

So the fix to the issue would be simply to change this part:

namespace LimeDeck\Testing;
use PHPUnit\Framework\Test;
use PHPUnit\Framework\Warning;
use PHPUnit\TextUI\ResultPrinter;
use PHPUnit\Util\Test as UtilTest;
use PHPUnit\Framework\AssertionFailedError;
class Printer extends ResultPrinter

to this:

namespace LimeDeck\Testing;

use PHPUnit\Framework\Test;
use PHPUnit\Framework\Warning;
use PHPUnit\TextUI\DefaultResultPrinter;
use PHPUnit\Util\Test as UtilTest;
use PHPUnit\Framework\AssertionFailedError;

class Printer extends DefaultResultPrinter
{
...
}

The printer is not compatible with `PHPUnit 7.0`

PHP Fatal error:  Declaration of LimeDeck\Testing\Printer::addError(PHPUnit\Framework\Test $test, Exception $e, $time) must be compatible with PHPUnit\TextUI\ResultPrinter::addError(PHPUnit\Framework\Test $test, Throwable $t, float $time): void in vendor/limedeck/phpunit-detailed-printer/src/Printer.php on line 226

Fatal error: Declaration of LimeDeck\Testing\Printer::addError(PHPUnit\Framework\Test $test, Exception $e, $time) must be compatible with PHPUnit\TextUI\ResultPrinter::addError(PHPUnit\Framework\Test $test, Throwable $t, float $time): void in vendor/limedeck/phpunit-detailed-printer/src/Printer.php on line 226

PHPUnit 7 Compatibility

Currently PHPUnit 7 is not supported. This seems to be because of the method signature change(s) in classes and interfaces between PHPUnit 5.6 and PHPUnit 7.

Suite stops on failure after adding this printer

I really like this test printer but the only issue I have so far is that as soon as a test fails the whole suite aborts. This behaviour seems to happen only with this printer.

Is this intentional or is it a bug?

Display test results more like a sentence

It would be awesome if test results could be displayed more like a sentence. For example:

✓ Door can be opened and closed
✓ Door has a handle on each side
✓ Door cannot be opened if locked

✓ Window can be opened and closed
✓ Window has a handle on each side
✓ Window cannot be opened if locked
✓ Window smashes if struck

or

Door
    ✓ can be opened and closed
    ✓ has a handle on each side
    ✓ cannot be opened if locked

Window
    ✓ can be opened and closed
    ✓ is transparent
    ✓ cannot be opened if locked
    ✓ smashes if struck

I appreciate this may not suit everyone, so maybe it could be enabled or disabled by a flag or something. Jest by facebook produces test results in the latter format, and it makes them very nice to read like a spec.

It looks like this:
image

You can see an example of this here

Currently, it shows the fully qualified class name, which can be a little verbose at times. Maybe this could only happen if someone turns debug or verbose on?

Requirements not defined

We came across this issue because the our library runs unit tests in the CI pipeline on php 7.1 up to php 8.0. When defining the requirement phpunit/phpunit with * it installs what ever is compatible to the current tested php version. But limedeck/phpunit-detailed-printer * always installs version 6.

In fact phpunit is not just a requirement for developement but also for production. In order to solve that every major version needs an update with the requirement of phpunit version.

If you want I can prepare some merge requests.

Not working inside laravel test

Hi, I wanted to add this to a laravel project, but when I ran my tests it prompts an error

Fatal error: Class 'PHPUnit\TextUI\ResultPrinter' not found in laravel-project\vendor\limedeck\phpunit-detailed-printer\src\Printer.php on line 12

Tests with [E]rrors don't show test name

Tests that fail because of an error in the test will not show the test name.
If the test follows another one it will show the name from the previous test.

✔ Tests\Integration\Jobs\PrepareVRDownloadTest: Could not get signature for device id (713 ms)
! Tests\Integration\Jobs\PrepareVRDownloadTest: Could not get signature for device id (713 ms)
✔ Tests\Integration\Jobs\PrepareVRDownloadTest: Copied signature for device id (765 ms)

Stopped working with phpunit 6.3

The same exact config with 5.7.21 works fine but with 6.3 returns:

PHPUnit 6.3.0 by Sebastian Bergmann and contributors.

Could not use "LimeDeck\Testing\Printer" as printer.

For what I see they removed the long class names and everything is now namespaced but I don't know if this has anything to do with this problem. Phpunit is not giving any details...

Regression for test names with data set in PHPUnit 7 (phpunit-detailed-printer ^4.0)

In version 3 name for test with data provider looks like the following:

(6/7) ✔ PrinterNamesTest: It Supports Data Provider with data set #0 ('a', 'b', 'bc') (%s ms)

But in version 4 there is no test data:

(6/7) ✔ PrinterNamesTest: It Supports Data Provider with data set #0 (0 ms)

I added tests for v3 branch [code] [travis]. And they are pass.

The same tests in v4 are fail [travis]

The reason for this behavior is split of the describe method in \PHPUnit\Util\Test commit

PHP 7.1.17
PHPUnit ^6.0 and ~7.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.