PHP version specific tests

21 views
Skip to first unread message

Jachim Coudenys

unread,
Nov 17, 2017, 10:01:28 AM11/17/17
to test...@phpcommunity.org
Hi,

I was chatting with Yulia Kostrikova on slack about the test in https://github.com/phpcommunity/phptestfest-php-src/pull/76/files.

In 7.2 it returns "resource (closed)", but in 7.1 it returns "unknown type".

My first response was to add a PHP_VERSION check in the SKIPIF, but this is almost used nowhere in tests.

What is the best solution to target different PHP versions?

Regards,
Jachim Coudenys
jachimc...@gmail.com

Rogerio Prado de Jesus

unread,
Nov 19, 2017, 4:05:07 PM11/19/17
to PHP TestFest
Good question, Jachim, I'll follow this discussion.

Jachim Coudenys

unread,
Nov 20, 2017, 4:27:08 AM11/20/17
to test...@phpcommunity.org
Hi,

The question was kind of answered on twitter by Sara (https://twitter.com/SaraMG/status/931637505065193472).

The reason why no PHP_VERSION can be found in SKIPIF in the codebase, is because the tests only apply to the version branch they were added to (and newer versions).

The test of Yulia fails because a new PHP version returns something different ("the output type is probably bugish"), which is should not (yay for testing).

Regards,
Jachim Coudenys
jachimc...@gmail.com

--
You received this message because you are subscribed to the Google Groups "PHP TestFest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testfest+unsubscribe@phpcommunity.org.
To post to this group, send email to test...@phpcommunity.org.
Visit this group at https://groups.google.com/a/phpcommunity.org/group/testfest/.
To view this discussion on the web visit https://groups.google.com/a/phpcommunity.org/d/msgid/testfest/045e7a7e-3763-40aa-b683-fdcec6dc9a5f%40phpcommunity.org.

Sammy Kaye Powers

unread,
Nov 21, 2017, 11:50:10 AM11/21/17
to test...@phpcommunity.org
Hey Jachim!

Nice find! This was brought up in the mailing list here: https://externals.io/message/101140 and it seems like everyone is on board with the BC.

So the "correct" answer is to just --EXPECT-- "resource (closed)" since that's what's expected on the master branch ATM. :)


Thanks,
Sammy Kaye Powers

--
You received this message because you are subscribed to the Google Groups "PHP TestFest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testfest+unsubscribe@phpcommunity.org.
To post to this group, send email to test...@phpcommunity.org.
Visit this group at https://groups.google.com/a/phpcommunity.org/group/testfest/.

Yulia Kostrikova

unread,
Nov 22, 2017, 9:16:37 AM11/22/17
to PHP TestFest
Ok, I will fix that test. And as I understood we don't have to care about SKIPIF version and merely write tests for the master branch?

Rogerio Prado de Jesus

unread,
Nov 22, 2017, 1:32:08 PM11/22/17
to Yulia Kostrikova, PHP TestFest
Hi, so I guess phptt is doing a great job on this, right, because in spite of the fact it can be run with any of the PHP versions listed in http://gcov.php.net/, by default it runs against PHP_HEAD (master branch), isn't? 

Then... 

phptt test <path-to-phpt>

phptt lcov <path-to-phpt>

phptt generate -f <function-name> [...] 

... all is going to run in "best possible branch"! 

For guys that doesn't know phptt yet, here is repository:

https://github.com/PHPTestFestBrasil/phptt

phptt, a.k.a php test tools,  is totally based on herdphp/docker-phpqa with several enhancements (we are working with original phpqa authors in order to merging both projects in just one). 

We definitely have to write some phptt tutorials for https://phptestfest.org website!!! 

Best 

Rogerio 
@RogerioPradoJ
PHPSP / PHPDF / PHPTestFestBrasil 
 



Sent from Astro for Android

On 22/11/17 at 12:16, Yulia wrote:

Ok, I will fix that test. And as I understood we don't have to care about SKIPIF version and merely write tests for the master branch?

--
You received this message because you are subscribed to the Google Groups "PHP TestFest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testfest+u...@phpcommunity.org.
To post to this group, send email to test...@phpcommunity.org.
Visit this group at https://groups.google.com/a/phpcommunity.org/group/testfest/.
To view this discussion on the web visit https://groups.google.com/a/phpcommunity.org/d/msgid/testfest/2cc8d689-8139-49c7-b8ca-fa2efa1754b9%40phpcommunity.org.
Reply all
Reply to author
Forward
0 new messages