sebastianbergmann
Repos
72
Followers
6848

The PHP Unit Testing framework.

18999
2068

Events

issue comment
Allow narrowing integer types using global constants

Adding a separate syntax to refer to constants in docblocks looks like a cleaner solution to me

You are right, I agree.

Created at 7 hours ago
issue comment
Allow narrowing integer types using global constants

The problem with E_ERROR | E_USER_ERROR is that it's not clear whether it refers to constants or classes.

Sure, but that could be "worked around" by only supporting that when use const E_ERROR etc. is used. That way Psalm should know that in the context of the current scope E_ERROR is a constant and not a class.

Created at 7 hours ago
`--stop-on-failure` no longer stops on errors

hello @sebastianbergmann , we are currently using v10.0.19 and phpunit is still not stopping using the flag --stop-on-defect when a warning is raised.

we also tried with dev-main 3a680a9 but still no luck. any ideas?

Please open a new ticket and provide a minimal, self-contained, reproducing test case that shows the problem you are reporting. Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue.

According to this test, --stop-on-defect correctly aborts test execution after the first test that triggered a warning.

Created at 9 hours ago
`--stop-on-failure` no longer stops on errors

Sorry to comment on a closed issue, but I see that this bug is supposed to be fixed in version 10.0.4, but I still get it:

bin/phpunit --stop-on-failure

PHPUnit 10.0.4 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.1.1
Configuration: /user/myapp/phpunit.xml.dist

.....E.......................................................     61 / 61 (100%)

Time: 00:05.680, Memory: 72.50 MB

There was 1 error

An error is not a failure, these are treated separately.

Created at 9 hours ago
issue comment
Allow narrowing integer types using global constants

Hey @sebastianbergmann, can you reproduce the issue on https://psalm.dev ?

Yes, my dear bot, I can.

https://github.com/vimeo/psalm/issues/9582#issue-1645866657 contains the reproducing example as well as the output generated by https://psalm.dev/ for it.

Created at 10 hours ago

Initial work on filtering deprecations, notices, and warnings

Created at 10 hours ago
opened issue
Allow narrowing integer types using global constants

I would like to narrow the type for $errorLevel from int to a specified list of possible integer values using global constants:

<?php declare(strict_types=1);
/** @psalm-param E_ERROR|E_USER_ERROR $errorLevel */
function f(int $errorLevel): void
{
}

This is currently not possible:

ERROR: [UndefinedDocblockClass](https://psalm.dev/200) - 2:18 - Docblock-defined class, interface or enum named E_ERROR does not exist

ERROR: [UndefinedDocblockClass](https://psalm.dev/200) - 2:18 - Docblock-defined class, interface or enum named E_USER_ERROR does not exist

ERROR: [MismatchingDocblockParamType](https://psalm.dev/141) - 2:18 - Parameter $errorLevel has wrong type 'E_ERROR|E_USER_ERROR', should be 'int'

The Psalm output shown above was was generated using commit e2abc3e.

Furthermore, and similarly to how class constants that share a common prefix are supported, I would like to be able to use the following:

<?php declare(strict_types=1);
/** @psalm-param E_* $errorLevel */
function f(int $errorLevel): void
{
}
Created at 10 hours ago
Setting custom PHP Path, especially used for process-isolation in PhpUnit

I need to define a PHP binary path in PhpUnit which will be used by PhpUnit, instead of the default from the OS.

I think such a use case is outside the scope of both this project as well as outside of PHPUnit.

That being said, I think PHP_BINARY !== '' is a leftover from a time where PHP_BINARY was not always available.

Created at 14 hours ago

Closes #5285

Merge branch '10.0'

Prepare release

Merge branch '10.0'

Add test for #5287

Merge branch '10.0'

Change test fixture for #5287 to more closely resemble a real world use case

Update test expectation

Merge branch '10.0'

Closes #5287

Merge branch '10.0'

Add test for #5288

Merge branch '8.5' into 9.6

Merge branch '9.6' into 10.0

Closes #5288

Merge branch '10.0'

Use rtrim() instead of str_replace()

Merge branch '10.0'

Prepare release

Merge branch '10.0'

Created at 17 hours ago

Fix CS/WS issue

Make Psalm happy

Merge branch '9.5'

Update tools

Merge branch '8.5' into 9.5

Merge branch '9.5'

Update tools

Merge branch '8.5' into 9.5

Merge branch '9.5'

Store test data in serialize()d form, if possible

Revert "Store test data in serialize()d form, if possible"

This reverts commit 9c6d7ad0cbe51bded7a987cee757594a276a6d19.

Reorganize

Store test data in serialize()d form, if possible

Revert "Store test data in serialize()d form, if possible"

This reverts commit 7aff2713c05843ae720a186b55e76fb55f911668.

Reorganize

Improve test names in fixture

Implement TestMethod::prettifiedClassName() and TestMethod::prettifiedMethodName()

Remove id

Improve type safety

Only consider method-level TestDox metadata

Created at 17 hours ago

Fix PHP attribute syntax error

Merge branch '10.0'

Created at 19 hours ago

Fix PHP attribute syntax error

Created at 19 hours ago
Fix PHP attribute syntax error in example
Created at 19 hours ago
Not sure why, but `windows-latest` requires `openssl` to install dependencies with `composer`. Works fine on `ubuntu-latest`.

I am not sure what to make of this ticket.

Created at 19 hours ago
issue comment
a note about the surprising behaviour of Git diff

Thanks!

Created at 1 day ago

readme: added note about Git diffs

https://www.artima.com/weblogs/viewpost.jsp?thread=164293

Created at 1 day ago
pull request closed
a note about the surprising behaviour of Git diff

https://www.artima.com/weblogs/viewpost.jsp?thread=164293

Created at 1 day ago

Follow RFC 4180 and use field instead of column

Follow RFC 4180 and use record instead of row

Implement Parser::setEnclosure()

Eliminate code duplication

Implement Parser::setEscape()

Created at 1 day ago

Refactor

Implement Parser::setSeparator()

Created at 2 days ago
sebastianbergmann create tag 10.0.19
Created at 2 days ago
sebastianbergmann create tag 9.6.6
Created at 2 days ago

Closes #5270

Fix section title

Prepare release

Merge branch '9.6' into 10.0

Prepare release

Merge branch '10.0'

Created at 2 days ago

Closes #5270

Prepare release

Merge branch '9.6' into 10.0

Prepare release

Created at 2 days ago