r/programming • • Dec 02 '15

PHP 7 Released

https://github.com/php/php-src/releases/tag/php-7.0.0
887 Upvotes

729 comments sorted by

View all comments

154

u/antpocas Dec 02 '15 edited Dec 02 '15

Ooh, only 137 compiler warnings and 102 failed tests! That's a huge improvement from 5.6's 638 warnings and 114 failed tests!

40

u/[deleted] Dec 02 '15

Those are incredibly poor tests. A great many of them depends on networked resources (read: www) which pretty much guarantees inconsistent results. If this is the quality of their test suite, no wonder why they don't pay attention to it.

28

u/[deleted] Dec 02 '15

Those are incredibly poor tests. A great many of them depends on networked resources (read: www) which pretty much guarantees inconsistent results.

How do you propose that something like the cURL extension be tested?

"A great many" of the tests don't use remote resources. A great many of the failing tests do, and this is why they fail, because they require special setup in order to succeed, which this automated report doesn't take into consideration.

The bulk of the warnings and failing tests are also in extensions which are not part of the PHP core.

0

u/[deleted] Dec 02 '15

[deleted]

42

u/[deleted] Dec 02 '15

The cURL extension is a thin wrapper around the library. Mocking the precise feature you're testing means you're not testing anything. Mocks exist to replace dependencies which are not part of the tested component's responsibility, but are required by it. In this case the responsibility of the cURL extension is to communicate with the actual cURL library.

Sometimes it's better to have test errors, than to have a cargo cult test suite that runs perfectly and tests nothing.

13

u/[deleted] Dec 02 '15

The cURL extension is a thin wrapper around the library

So it should be really simple to test, without needing to actually call cURL. There is no excuse for a test suite that calls out to network resources.

7

u/estarra Dec 02 '15

There is no excuse for a test suite that calls out to network resources.

For unit tests, sure. For functional tests, you test whatever your code is supposed to be doing: network calls, db fetches, etc...

→ More replies (5)