Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all skipped tests with PHPUNIT

Tags:

php

phpunit

I have searched and read the docs, or at least I think I have, but I have been unable to find if there a way to get a list of all the skipped tests with PHPUNIT?

Is this possible?

like image 686
whoacowboy Avatar asked Apr 07 '16 02:04

whoacowboy


People also ask

What are PHPUnit fixtures?

One of the most time-consuming parts of writing tests is writing the code to set the world up in a known state and then return it to its original state when the test is complete. This known state is called the fixture of the test.

How do I run a single PHPUnit test?

You can run all the tests in a directory using the PHPUnit binary installed in your vendor folder. You can also run a single test by providing the path to the test file. You use the --verbose flag to get more information on the test status. The output shows that we ran 1 test, and made 3 assertions in it.

What is assertion in PHPUnit?

PHPunit | assertEquals() Function The assertEquals() function is a builtin function in PHPUnit and is used to assert whether the actual obtained value is equals to expected value or not. This assertion will return true in the case if the expected value is the same as the actual value else returns false.

What is PHPUnit testing?

PHPUnit is a unit testing framework for the PHP programming language. It is an instance of the xUnit architecture for unit testing frameworks that originated with SUnit and became popular with JUnit. PHPUnit was created by Sebastian Bergmann and its development is hosted on GitHub.


1 Answers

You could get something close using awk:

phpunit -v | awk '/skipped tests/,/Tests\:/'

This will output a list from the start of There are x skipped tests to the end of the output with the summary line

like image 197
user3791372 Avatar answered Oct 09 '22 21:10

user3791372