Something to read about testing PHP?

Hi all, up to this point, all code was written without testing, it is time to test, I found out that there are different types of tests and unit tests are the Foundation. Learned that PHPUnit is the most popular solution for this. The question is, will I absolutely not familiar with the test by reading the PHPUnit Doc, to understand what kind of animal and write good tests, or need any articles to read on the subject for beginners or best practices. If you follow the option with articles, I will be glad links. Thanks in advance
June 10th 19 at 16:15
5 answers
June 10th 19 at 16:17
Solution
To see:
https://habrahabr.ru/post/169381/
https://habrahabr.ru/post/335834/

See:
https://www.youtube.com/watch?v=8u6_hctdhqI

Read:
Roy Osherove The Art of Unit Testing - 2014
Gerard Meszaros Pattern xUnit test. Refactoring test code - 2009
The M. feathers, as working Effectively with legacy code - 2009
Thanks, the first article is very useful, the second only partly, there is a complete bias on DDD, and judging by the comments, pretty sad implemented. Nesomnenno there to emphasize the idea at first to write tests, and after methods + clear naming of test methods. Also read 2 Chapter of the PHPUnit documentation and phpprofi.ru/blogs/post/24 the article, which took off , beginning to slowly understand the usefulness of the tests and what it is. I hope that tomorrow will be able to get acquainted with the documentation + see the video that You took off and re-read 2 article Habra, maybe I missed a lot because of fatigue. In any case, thank you - Kennedi_Thompson commented on June 10th 19 at 16:20
and Extreme programming. Kent Beck. why forgotten?) - Izaiah commented on June 10th 19 at 16:23
June 10th 19 at 16:19
Solution
Understand it or not at the docks, we are unlikely to guess. We don't know your mindset and ability
Actually articles a lot of times two three and so on.
Choose what it is you do.
Thank you, yet managed to read the Doc and 3 of the article that you threw. I hope tomorrow the rest. - Kennedi_Thompson commented on June 10th 19 at 16:22
June 10th 19 at 16:21
Hi!
I hope it will not see my prospective employer.
A year ago I learned about PHPUnit. Was scared too. I realized the depth of the abyss between me and the testing.
A month ago I talked. Set. Connected to Simfony. Written by two of integration for the two most important controllers. Use assertEquals, assertContains and very simple and cool assertThat. More comfortable adapting @dataProvider and @depends.
All this was enough:
1) some article
2) official symfony doc
You know, life has become easier. Just because you did it. And everything else will follow.
June 10th 19 at 16:23
In my opinion, it is easiest to start with smoke (smoke) tests. This tests that only test the performance of the page by checking the HTTP status code and possibly the presence of some HTML elements on the page. This is the most simple and the cheapest in the world tests.

On habré there are article description: Cover project smoke tests until it burned down, but there is a bike. I would recommend to use Player.
June 10th 19 at 16:25

Find more questions by tags Testing softwarePHP