by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 17:23
    Levivb commented #4297
  • 13:42

    sebastianbergmann on master

    Refactor code coverage static a… (compare)

  • 13:42

    sebastianbergmann on 9.3

    Refactor code coverage static a… (compare)

  • 12:43
    sebastianbergmann closed #55
  • 12:43
    sebastianbergmann commented #55
  • 12:43
    sebastianbergmann transferred #4409
  • 12:43
    rieschl opened #55
  • 12:38

    sebastianbergmann on master

    Fix bad merge (compare)

  • 11:17
    rieschl labeled #4409
  • 11:17
    rieschl opened #4409
  • 11:05
    Danon commented #998
  • 10:43

    sebastianbergmann on master

    Configure <phpunit cacheResultF… (compare)

  • 07:37

    sebastianbergmann on master

    Leftover from e2b5eeac543b69986… Fix issues identified by Psalm Update Psalm baseline and 5 more (compare)

  • 07:06

    sebastianbergmann on 9.3

    Update Psalm baseline (compare)

  • 06:50

    sebastianbergmann on 9.3

    Leftover from e2b5eeac543b69986… Fix issues identified by Psalm Update Psalm baseline and 3 more (compare)

  • 00:48
    DanNYSPD commented #2789
  • Aug 08 13:29
    dvdoug commented #4404
  • Aug 08 13:24
    sebastianbergmann commented #4404
  • Aug 08 13:21
    dvdoug commented #4404
  • Aug 08 12:59
    jrfnl commented #4404
Paul
@gargoyle
OK. I figured it out. My request objects needed to be wrapped into an array, but my responses didn't. (Obvious when you think a method can have many args and only 1 return value- :-)
James Van Gelder
@JamesVG1
Does anyone know how to run unit tests?
Daniel Ruf
@DanielRuf
phpunit foldername @JamesVG1
Or path.
Juris
@jurchiks
hey guys, i have a problem with a unit test that seems to have no solution - it involves MockBuilder::enableProxyingToOriginalMethods()
could anyone here help, perhaps?
I was about to write an issue on github, but it suggested to try gitter/stackoverflow first.
Welp, here's the test case for this weird issue: https://gist.github.com/jurchiks/fd690dee6f7215a2eab1d90712463950
The reason for calling enableProxyingToOriginalMethods() in the first place is that I'm trying to mock a class whose parent implements magic methods, and I need those to work.
Thomas B
@gevalo1

Hi! Recently we updated our php version from 7.0.x to 7.3.9 and I'm struggling to get the Dockerfile to run tests in CI to work without warnings/errors.

I keep seeing the following warnings no matter what I try:

  • Warning: DOMDocument::schemaValidate(): Invalid Schema in /***/***/***/vendor/phpunit/phpunit/src/Util/Configuration.php on line 945
  • Warning - The configuration file did not pass validation!
    The following problems have been detected:
    Line 0:
    • failed to load external entity "/***/***/***/vendor/phpunit/phpunit/phpunit.xsd"
    • Failed to locate the main schema resource at '/***/***/***/vendor/phpunit/phpunit/phpunit.xsd'.
      Test results may not be as expected.

It worked fine before using php 7.0.x & phpunit 4.8.26, we now use php 7.3.9 & phpunit 8.3.5.
It also works fine on our own development machines...

Does anyone have an idea what could be going on?

Daniel Ruf
@DanielRuf
@gevalo1 which PHP extensions are installed and loaded?
Thomas B
@gevalo1
@DanielRuf I added both php -i & php -m to this gist: https://gist.github.com/gevalo1/de30abd6856a4bd52ad88b3d9bd03d6e
Leandro Biciato
@Biciato
Hello, i'm getting this exception ReflectionException: Method suite does not exist
Thomas B
@gevalo1
@DanielRuf , The issue is that the Jenkins workspace folder contains an encoded / (%2F). This worked previously, I haven't found what exactly changed to cause the issue but it's definitely not related to PHPUnit.
Stuardo Rodriguez
@stuardo_gitlab
Hi!

I have a method that accepts a param, like public function foo($param) and I had a test that checked if the param was null or false, expecting an exception.

Now, with new typed PHP I can set my public function foo(MyClass $param) and my test now shows me in my IDE that I'm not sending the right param type.

My question is: should I keep my tests that check for an expected exception for null and false? That will help keep checking in the future to see if by any chance the function changes to public function foo(?MyClass $param)
if so, how can I disable the type validation in my IDE/vscode, for those methods?
OR, if I should get rid of the tests, as it feels I'm testing PHP itself to see if the typed params are working.
Thank you all in advance.
Ewout Pieter den Ouden
@epdenouden
goodmorning from Bruxelles and the EU security hackathon
@stuardo_gitlab which also means, somebody is checking on the Gitter chat again ;-)
Stuardo -StR- Rodríguez
@str
Hi @epdenouden , yes... it looks this chat is not that active. Any ideas where to ask for help?
Gytis Šk.
@gskema
Hello, are there any tools to profile PHPUnit test runs by memory?
It says that it's compatible with PHPUnit ^6, but we have 7.5.*. Can it be made to work with PHPUnit 7 @sebastianbergmann ? Thank You
altarrok
@altarrok
Hey, Im new in PHPUnit and PHP and I have an error with my simplest test. Can anyone help me please?
Ryein Goddard
@Goddard
when running a test I get this error before any of my test functions run. Warning: Invocation with class name is deprecated
i used --debug and it is before the function names
Nicolas Hohm
@nickel715
@Goddard looks like you are running phpunit with class name of the test class as cli parameter. You can find an example in this end to end test: https://github.com/sebastianbergmann/phpunit/blob/7250fc06d7ca101e2862bd97e61ad5bc5f4df3db/tests/end-to-end/abstract-test-class.phpt
Ryein Goddard
@Goddard
@nickel715 haha thanks man
rspiewak47
@rspiewak47
I'm trying to use phpunit in VS2019. Trying to run a simple unit test, I'm getting an error "Could not find type PHPUnit\Util\Printer"
Inside of PhpTestingPrinter-7.0.php I also see undefined references to PHPUnit\Framework\Test
Ryein Goddard
@Goddard
did you install with composer?
rspiewak47
@rspiewak47
Yes
Ryein Goddard
@Goddard
and your autoload is setup in your project?
rspiewak47
@rspiewak47
How can I tell?
Ryein Goddard
@Goddard
it would be something you added to your project. Are you using some framework?
usually people have like a bootstrap file that loads their composer files
rspiewak47
@rspiewak47
No.
Ryein Goddard
@Goddard
need to include like vendor/autoload.php
something like that
in your index.php or whatever your root file is
rspiewak47
@rspiewak47
I just went to References, and selected "Install New Composer Packages" to get it.
(I'm used to using VS for .NET development, currently experimenting with tools for PHP)
Ryein Goddard
@Goddard
if you installed it globally then you will have it globally so you can type phpunit in the command line
rspiewak47
@rspiewak47
Not recognized in PowerShell
Ryein Goddard
@Goddard
probably wrapped in vs
i do not use visual studio, but i use vscode