by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 14:54

    sebastianbergmann on master

    JIT DX FTW: Use 1255 instead of… (compare)

  • 09:22
    codecov[bot] commented #4346
  • 09:22
    codecov[bot] commented #4346
  • 09:20
    codecov[bot] commented #4346
  • 09:20
    codecov[bot] commented #4346
  • 09:19
    epdenouden synchronize #4346
  • 09:03
    localheinz commented #4363
  • 08:28

    sebastianbergmann on master

    Fix: Do not run tests with PHP … (compare)

  • 08:27
    sebastianbergmann closed #4363
  • 08:27
    codecov[bot] commented #4363
  • 08:27
    codecov[bot] commented #4363
  • 08:27
    codecov[bot] commented #4363
  • 08:27
    codecov[bot] commented #4363
  • 08:27
    codecov[bot] commented #4363
  • 08:27
    codecov[bot] commented #4363
  • 08:26
    codecov[bot] commented #4363
  • 08:26
    codecov[bot] commented #4363
  • 08:26
    codecov[bot] commented #4363
  • 08:24
    localheinz assigned #4363
  • 08:24
    localheinz review_requested #4363
Marco Pivetta
@Ocramius
Florian Engelhardt
@flow-control
:thumbsup:
Andreas Heigl
@heiglandreas
I've prepared a PoC that allows creating Tests that do not inherit from TestCase. It might not be the right way but it could be a base of discussion: The code is at https://github.com/heiglandreas/phpunitstub
Ewout Pieter den Ouden
@epdenouden
@DanielRuf no, I wasn't able to start on that yet :( feel free to pick it up! shall I assign it to you?
Marco Pivetta
@Ocramius
@oliverklee
diff --git a/src/Framework/TestSuite.php b/src/Framework/TestSuite.php
index 2fca3b8dd..2e8f82338 100644
--- a/src/Framework/TestSuite.php
+++ b/src/Framework/TestSuite.php
@@ -617,7 +617,7 @@ public function testAt(int $index)
     /**
      * Returns the tests as an enumeration.
      *
-     * @return Test[]
+     * @return TestCase[]
      */
     public function tests(): array
     {
@@ -627,7 +627,7 @@ public function tests(): array
     /**
      * Set tests of the test suite
      *
-     * @param Test[] $tests
+     * @param TestCase[] $tests
      */
     public function setTests(array $tests): void
     {
diff --git a/src/Runner/TestSuiteSorter.php b/src/Runner/TestSuiteSorter.php
index fda662ac7..1a28f5e54 100644
--- a/src/Runner/TestSuiteSorter.php
+++ b/src/Runner/TestSuiteSorter.php
@@ -358,6 +358,10 @@ private function cmpSize(Test $a, Test $b): int
      * @param array<DataProviderTestSuite|TestCase> $tests
      *
      * @return array<DataProviderTestSuite|TestCase>
+     *
+     * @psalm-template T of array<DataProviderTestSuite|TestCase>
+     * @psalm-param T $tests
+     * @psalm-return T
      */
     private function resolveDependencies(array $tests): array
     {
Ewout Pieter den Ouden
@epdenouden
@DanielRuf I'll fix up #3730 this week, it is related to TestDox which I had been working on
getting the TestSuite name isn't that hard, however I'll have to go over the edge cases
having said that, feel free to hurt yourself, if you really want to ;-)
Stephan Hochdörfer
@shochdoerfer
Food order done!
Marco Pivetta
@Ocramius
need a review and a performance analysis (from whoever worked on kcachegrind yesterday) at sebastianbergmann/phpunit#3836
Daniel Ruf
@DanielRuf

@DanielRuf I'll fix up #3730 this week, it is related to TestDox which I had been working on

I'm not so deep into it yet. Might make more sense if you take it up as you msay have a better overview of (possible) edge cases =)

Andreas Möller
@localheinz
This message was deleted
11EDC2BC-30CB-42D1-87C1-7F80E2B65850
@sebastianbergmann The error message regarding git when running psalm disappears with sebastianbergmann/phpunit#3838. However, the psalm error remains. Taking a look!
Andreas Möller
@localheinz
@sebastianbergmann @flow-control Global State
Ewout Pieter den Ouden
@epdenouden
@localheinz $_CARPET
Andreas Möller
@localheinz
@epdenouden wat
Ewout Pieter den Ouden
@epdenouden
Stephan Hochdörfer
@shochdoerfer
Food ETA 13:25
Ewout Pieter den Ouden
@epdenouden
@DanielRuf okidoki! I'll treat myself to another round of CliTestDoxPrinter :cherries:
Andreas Heigl
@heiglandreas
I'm digging nito XSLT now....
Michel Hartmann
@MichelHartmann
$foo = $this->createMock(Foo::class);
        $foo->method('doSomething')
            ->after($id); // <- what's the expected behaviour of this method?
Daniel Ruf
@DanielRuf
Marco Pivetta
@Ocramius
Ewout Pieter den Ouden
@epdenouden
for those that don't feel confident fiddling around with Test|TestCase|TestSuite|DataProviderTestSuite...
image.png
Marco Pivetta
@Ocramius
@SenseException Ocramius:chore/annotations-refactoring
@SenseException git@github.com:Ocramius/phpunit.git
Florian Engelhardt
@flow-control
Michel Hartmann
@MichelHartmann
@flow-control seems save to delete them.
Ewout Pieter den Ouden
@epdenouden
Sebastian Bergmann
@sebastianbergmann
@localheinz https://github.com/sebastianbergmann/docker-amiga-gcc/blob/master/Dockerfile ist das einzige Dockerfile, mit dem ich bislang regelmäßig arbeite ;-)
Ewout Pieter den Ouden
@epdenouden
@localheinz I've put the power adapter of your laptop is in Stephan's office your hands
Marco Pivetta
@Ocramius
@sebastianbergmann sebastianbergmann/phpunit#3836 nao green @_@
Oliver Klee
@oliverklee
./tools/psalm --config=.psalm/config.xml
Paul
@gargoyle

Hi. 8.3.4 -> 8.3.5 broke a whole bunch of tests. I've got this method to create a mock guzzle client which will expect a sequence of requests and return a related sequence of responses.

Works fine in 8.3.4. However, 8.3.5 throws this error:-

PHPUnit\Framework\InvalidParameterGroupException: Parameter group #0 must be an array or Traversable, got object

/Users/paul_court/devel/hotelmap/hm-tps/src/tests/Infrastructure/OAuth/OktaClientTest.php:39
/Users/paul_court/devel/hotelmap/hm-tps/src/tests/Infrastructure/OAuth/OktaClientTest.php:51
Oops... missed link to gist with method:- https://gist.github.com/gargoyle/4471bc2e72c75247eefcdc37480552e
Line 39 in the error message is line 31 in the gist... The call to ->withConsecutive(... $allRequests)
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?