Skip to content

Commit

Permalink
Also mark internal units of code as deprecated for #5241, #5242, #5243,
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Aug 18, 2023
1 parent 53b1e70 commit b82ee92
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .psalm/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,18 @@
<code>$methods</code>
<code>$type</code>
</ArgumentTypeCoercion>
<DeprecatedClass>
<code><![CDATA[new MockTrait(
$classTemplate->render(),
$className['className'],
)]]></code>
<code><![CDATA[new MockTrait($classTemplate->render(), $className['className'])]]></code>
<code>new UnknownTraitException($traitName)</code>
<code>new UnknownTraitException($traitName)</code>
</DeprecatedClass>
<DeprecatedMethod>
<code>mockObjectForAbstractClass</code>
</DeprecatedMethod>
<MissingThrowsDocblock>
<code>getMethod</code>
</MissingThrowsDocblock>
Expand Down Expand Up @@ -263,6 +275,10 @@
</PossiblyFalseOperand>
</file>
<file src="src/Framework/MockObject/MockBuilder.php">
<DeprecatedMethod>
<code>mockObjectForAbstractClass</code>
<code>mockObjectForTrait</code>
</DeprecatedMethod>
<InvalidReturnStatement>
<code>$object</code>
<code>$object</code>
Expand Down Expand Up @@ -314,6 +330,10 @@
<code>disableArgumentCloning</code>
<code>disallowMockingUnknownTypes</code>
<code>enableProxyingToOriginalMethods</code>
<code>generateClassFromWsdl</code>
<code>mockObjectForAbstractClass</code>
<code>mockObjectForTrait</code>
<code>objectForTrait</code>
</DeprecatedMethod>
<MissingThrowsDocblock>
<code>getMethod</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/5243
*/
final class UnknownTraitException extends \PHPUnit\Framework\Exception implements Exception
{
Expand Down
8 changes: 8 additions & 0 deletions src/Framework/MockObject/Generator/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ public function testDoubleForInterfaceIntersection(array $interfaces, bool $mock
* @throws RuntimeException
* @throws UnknownClassException
* @throws UnknownTypeException
*
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/5241
*/
public function mockObjectForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = null, bool $cloneArguments = true): MockObject
{
Expand Down Expand Up @@ -286,6 +288,8 @@ interface_exists($originalClassName, $callAutoload)) {
* @throws UnknownClassException
* @throws UnknownTraitException
* @throws UnknownTypeException
*
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/5243
*/
public function mockObjectForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = null, bool $cloneArguments = true): MockObject
{
Expand Down Expand Up @@ -323,6 +327,8 @@ public function mockObjectForTrait(string $traitName, array $arguments = [], str
* @throws ReflectionException
* @throws RuntimeException
* @throws UnknownTraitException
*
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/5244
*/
public function objectForTrait(string $traitName, string $traitClassName = '', bool $callAutoload = true, bool $callOriginalConstructor = false, array $arguments = []): object
{
Expand Down Expand Up @@ -406,6 +412,8 @@ public function generate(string $type, bool $mockObject, array $methods = null,
/**
* @throws RuntimeException
* @throws SoapExtensionNotAvailableException
*
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/5242
*/
public function generateClassFromWsdl(string $wsdlFile, string $className, array $methods = [], array $options = []): string
{
Expand Down
2 changes: 2 additions & 0 deletions src/Framework/MockObject/Generator/MockTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/5243
*/
final class MockTrait implements MockType
{
Expand Down

0 comments on commit b82ee92

Please sign in to comment.