Comments (9)
@Bilge You can use this extension that uses Collision: https://github.com/robiningelbrecht/phpunit-pretty-print
from collision.
OK, but that seems like it does a lot more than just enable Collision, what with the Chuck Norris quotes and other unnecessary guff.
In reality, isn't this the single and only line that is actually needed to enable the printer?
from collision.
@Bilge Everything is disabled by default.
And yes that line is the bare minimum you need to run Collision, but I think you need to run it in an PHPUnit extension to make it work.
from collision.
I imagine you could just run it in the bootstrap file, no?
from collision.
@Bilge That might an option as well indeed, never tried this before.
Since PHPUnit 10 I tend to work with the "extensions and events" it provides...
from collision.
It seems this is wrong. There appears to be some autoload trick going on that causes EnsurePrinterIsRegisteredSubscriber::register();
to be called automatically (see Autoload.php
). Therefore, the only thing required to enable the printer is to ensure COLLISION_PRINTER
environment variable is set (to anything, including nothing).
However, when I do this, although the printer is enabled, the output is messed up as it is now a mish-mash of Collision and PHPUnit output (it outputs the dots (...
) between tests). Moreover, the text colour is dark grey which is difficult to read; I don't know if this is intended or not, but it wasn't the case with v6.
If I use your extension, the dots go away, but the text is still illegible. Presumably the dots are fixed by instructing PHPUnit to omit its own test output as here: https://github.com/robiningelbrecht/phpunit-pretty-print/blob/5d42dbf9d92a6299d3307d59b1a67c9eba22e065/src/PhpUnitExtension.php#L24C18-L24C39 What is strange about this is that there does not appear to be any equivalent call in Collision itself. But how do we even know Collision v7 even works with PHPUnit, considering its own test suite does not appear to activate the printer at all?
Aside, the text colour in v6 was also grey, but a lot lighter.
from collision.
@Bilge yeah indeed, you need to disable PHPUnit10's output, forgot about that, sorry.
But how do we even know Collision v7 even works with PHPUnit
Because the extension you are referring to has it's own test suite and proves it works?
from collision.
Related Issues (20)
- Dependency `phpunit/phpunit` should move from dev to `require` in `composer.json` HOT 1
- Coverage report section is not displayed after upgrading to PHPUnit 10 HOT 1
- Laravel version check failed with Laravel 10+ HOT 1
- php artisan test doesnt run
- PHPUnit errors are not shown in test output HOT 1
- collision
- Package test command fails if phpunit.xml file does not exist
- PHPUnit autoload not working HOT 2
- Using Collision's printer in Laravel Dusk
- Unable to run 'artisan test' in verbose mode HOT 1
- PhpUnit 10.3 introduced some breaking changes HOT 2
- TestCommand > Passing on ini settings to phpunit/paratest HOT 1
- Is it possible to add the progress % to the PHPUnit printer? HOT 5
- Option to print previous exception HOT 1
- Exception Handler `dontReportDuplicates` Erroring on Fresh Install HOT 1
- Error when trying to load a data collection
- Empty test class doesn't show warning, but breaks CI by passing on non-zero STDERR from PHPUnit HOT 4
- Failed to open stream: Too many open files HOT 1
- [7.x] Misleading error message for incompatible PHPUnit version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from collision.