Giter Site home page Giter Site logo

PHP Warnings marked as F about paraunit HOT 11 CLOSED

facile-it avatar facile-it commented on June 8, 2024
PHP Warnings marked as F

from paraunit.

Comments (11)

Jean85 avatar Jean85 commented on June 8, 2024

Can you please post here the plain output of the test using PHPUnit (and not Paraunit?)

from paraunit.

Algatux avatar Algatux commented on June 8, 2024
PHPUnit 4.8.21 by Sebastian Bergmann and contributors.

PHP Warning:  sprintf(): Too few arguments in /var/www/collaboratori2/src/Facile/Cbr/AgendaBundle/Tests/Functional/Controller/CollaboratoreNonProduttivoControllerTest.php on line 53
.
Warning: sprintf(): Too few arguments in /var/www/collaboratori2/src/Facile/Cbr/AgendaBundle/Tests/Functional/Controller/CollaboratoreNonProduttivoControllerTest.php on line 53


Time: 1.05 seconds, Memory: 89.00Mb

OK (1 test, 4 assertions)

from paraunit.

Jean85 avatar Jean85 commented on June 8, 2024

Ah understood. The issue is in the parser: the regex tries to identify the test's results, and it catches some capital F within the warnings. I'm not sure if this could be fixed, I'll try to improve the regex.

from paraunit.

Jean85 avatar Jean85 commented on June 8, 2024

I did some research, and I found that PHPUnit should intercepts PHP Errors and warnings:

By default, PHPUnit converts PHP errors, warnings, and notices that are triggered during the execution of a test to an exception. Using these exceptions, you can, for instance, expect a test to trigger a PHP error [...]

I can't reproduce your problem with a test, how are you getting it @Algatux ?

from paraunit.

Algatux avatar Algatux commented on June 8, 2024
sprintf("text %s, %s",'hello');

from paraunit.

Jean85 avatar Jean85 commented on June 8, 2024

With that, I got this:

PHPUnit 5.1.0 by Sebastian Bergmann and contributors.

...E...                                                             7 / 7 (100%)

Time: 86 ms, Memory: 3.50Mb

There was 1 error:

1) Paraunit\Tests\Unit\TestResultsParserTest::testParseAndContinue with data set #3 (Paraunit\Tests\Stub\StubbedParaProcess Object (...), 'PROVA')
sprintf(): Too few arguments

/home/paraunit/projects/src/Paraunit/Tests/Unit/TestResultsParserTest.php:17

FAILURES!
Tests: 7, Assertions: 12, Errors: 1.

I thought that PHPUnit 5 could cause the issue, but I got the same output with 4.8...

from paraunit.

Algatux avatar Algatux commented on June 8, 2024

Is it possible that using a dataprovider implies a change in the output message ?

from paraunit.

taueres avatar taueres commented on June 8, 2024

Is the malformed sprintf executed in the dataProvider?

from paraunit.

Jean85 avatar Jean85 commented on June 8, 2024

No, I'm doing it in the test. Anyhow, it's the documented behavior. You have the sprintf in a Symfony controller maybe? Maybe Symfony is catching the warning in some way...

from paraunit.

taueres avatar taueres commented on June 8, 2024

It looks like PhpUnit does not capture warnings while executing a test provider.
Here is an example: https://gist.github.com/taueres/0bf3c29b70736a9178b9

from paraunit.

Jean85 avatar Jean85 commented on June 8, 2024

Closing this as not reproducible. I will try to improve the regex in the future to avoid similar issues.

from paraunit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.