Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Sep 17 14:37
    damodharan108 commented #3868
  • Sep 17 14:37
    damodharan108 commented #3868
  • Sep 17 14:37
    damodharan108 commented #3868
  • Sep 17 14:33
    sebastianbergmann commented #3868
  • Sep 17 14:33
    sebastianbergmann closed #3868
  • Sep 17 14:33
    sebastianbergmann commented #3868
  • Sep 17 14:32
    damodharan108 labeled #3868
  • Sep 17 14:32
    damodharan108 opened #3868
  • Sep 17 06:23

    sebastianbergmann on 3.1.1

    (compare)

  • Sep 17 06:23
    sebastianbergmann closed #84
  • Sep 17 06:23

    sebastianbergmann on master

    Closes #84 (compare)

  • Sep 17 06:21
    sebastianbergmann edited #84
  • Sep 17 06:17
    Arcesilas opened #84
  • Sep 17 05:14

    sebastianbergmann on master

    Eliminate superfluous variable Remove fine-grained code covera… Fix CS/WS issues and 1 more (compare)

  • Sep 16 06:31
    heiglandreas commented #3833
  • Sep 16 06:24
    sebastianbergmann commented #3833
  • Sep 16 06:22
    localheinz commented #3833
  • Sep 16 06:22
    localheinz commented #3833
  • Sep 15 06:20
    sebastianbergmann closed #3867
  • Sep 15 06:20
    sebastianbergmann commented #3867
Adrian
@adrian-enspired
i have a lot of classes that will need various methods mocked across different tests. trying to take a "decorator" approach to mocking them.
(so it's not that i need a method to mock a given method for two different calls; it was a potential workaround: mock everything to invoke the original method, then call method a second time to override specific methods as desired. but didn't work.)
Adrian
@adrian-enspired
thanks for your answers!
David Fox
@DFoxinator
no problem. yeah, as far as I know for this use case the specific methods that you need to mock have to be specified in something like setMethods or createPartialMock, you can't just call ->method on a method that hasn't been specified there unless you are using something like createMock (which mocks all methods, but then none are "pass through".
Adrian
@adrian-enspired
k. unfortunate... but good to know for sure. thanks again
Luis Jimenez
@ingluisjimenez

@adrian-enspired that seems to be an interesting feature. Like, create a Test Proxy with the ability to override some methods without explicitly specifying the methods that you plan to mock at some point. Have all methods call the original method by default, but allow the tester to mock any of the calls at any time.

Here you can read more on the concept of Test Proxies sebastianbergmann/phpunit-mock-objects#132, but it doesn't support mocking methods once the proxy is created, it is 100% proxy.

Luke Leber
@LukeLeber
Hello all. Is there an existing way to store phpunit results in a SQL database? I tried searching around but nothing came up on the first page.
The ultimate goal here is to be able to feed results to Microsoft PowerBI
Markus Podar
@mfn

When running CI, is there a way to output any test warnings/errors immediately without having to wait for the whole suite to finish?

I'm aware of https://github.com/ScriptFUSION/PHPUnit-Immediate-Exception-Printer which is old and doens't work with the latest phpunit anyway.

Just want to gauge if there's another approach. I tried --teamcity and --testdox but they have even more verbose output and I would need only warnings/errors, no success (so the CI log is condensed to the essential information).

Ewout Pieter den Ouden
@epdenouden
hi there, thought I'd stick my head in Gitter again
Ewout Pieter den Ouden
@epdenouden
@mfn good question, I don't think there is currently
what you would like is no output, except for failures and warnings and get those immediately
--testdox might even cache all of the run results to be able to put them back in the original order
Ewout Pieter den Ouden
@epdenouden
well, just going to put this out here: sebastianbergmann/phpunit#3736
Markus Podar
@mfn

@epdenouden

A picture is worth a thousand data points.

Love that :)

Markus Podar
@mfn

good question, I don't think there is currently

I guess so too.

I wonder why not more people would have request for such a feature. Especially on large test suites which take longer, the earlier the feedback, the better.

Ewout Pieter den Ouden
@epdenouden
@mfn I want something like that myself, too, it would be very useful during development.
Is there a ticket/issue for it already?
Markus Podar
@mfn
I can create one 🤞
Ewout Pieter den Ouden
@epdenouden
please do! coming weeks I'll (hopefully) be busy building the upgraded data providers
after that I'd be happy to look at logging some more; have some small requests gathering dust
github issues never turn out like fine wine, do they :(
there's still some buffering+sequencing stuff to be looked at and your request fits right in
Markus Podar
@mfn

I mean https://github.com/ScriptFUSION/PHPUnit-Immediate-Exception-Printer really worked well for the older phpunit I tried it.

And it's not a lot code to adapt fix but the project sees dormant and I feel like a direct addition in phpunit would be interesting to a lot of people. Or so

Ewout Pieter den Ouden
@epdenouden
it would
let's have a quick look at that plugin
hmmm that screenshot looks a lot like the colorized TestDox in v8
that gives you too much output still?
Markus Podar
@mfn

I'm open to this TBH, but the current testdox/teamcity feel way to verbose.

I'm not interesting in specifics of successful tests but about failed ones needed to be fixed.

Ewout Pieter den Ouden
@epdenouden
thx :)
I relate to that a lot! I only want to see what is still borking
you know about --order-by=defects?
it sorts all previously failed tests to the front of the run as much as possible
I use that a lot when cycling [make small change -> run -> oops -> repeat]
Markus Podar
@mfn

Personally I don't have local development in mind; I use PhpStorm built in unit runner which already solves my problem.

But not all test suites are suitable to be run locally, especially with integration tests, and may take >10 minutes but the earlier I know what tests failed, the sooner I can get productive again.

Ewout Pieter den Ouden
@epdenouden
yes, test collections get ever larger and those use cases can be supported better
PhpStorm/IntelliJ indeed have this "run defects first" option built-in
really handy!
Markus Podar
@mfn
Hmm, Mr. Bergmann feels otherwise unfortunately ( in regards to sebastianbergmann/phpunit#3737 )
Ewout Pieter den Ouden
@epdenouden
welllllll yeah we've been here before
he is correct though, preferably somebody would update the printer plugin
did you have a look how much work that would be?
I mean: is it only the declared return/param types that were recently introduced? I have no idea how that printer works
I am a bit preoccupied with refactoring data providers for the next while
akshaygoyal614
@akshaygoyal614
hi , i need help
anybody is there?
I am new in php unit and i just saw some tutorials. I installed phpunit by composer require phpunit/phpunit command and created phpunit.xml file and defined bootstrap = vendor/autoload.php in xml file and created a folder tests on root but i am still getting the configuration and other things
Nicolas Hohm
@nickel715
@akshaygoyal614 sounds all good so far. can you precise your question please.
Markus Podar
@mfn

I mean: is it only the declared return/param types that were recently introduced? I have no idea how that printer works

I think something with namesspaces and change exceptions type or so. I believe the fix is rather easy but the package tries to be so compatible down to PHPUnit 5/6 that it's no fun and I'm almost tempted to just create my own version from 8 and onwards.