Skip to content

Commit

Permalink
Rename test
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Oct 20, 2023
1 parent 42e0c55 commit 73798a8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/unit/Framework/MockObject/TestDoubleTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@ final public function testMethodCanBeConfiguredToThrowAnException(): void
$this->fail();
}

public function testMethodWithNeverReturnTypeDeclarationThrowsException(): void
{
$double = $this->createTestDouble(InterfaceWithNeverReturningMethod::class);

$this->expectException(NeverReturningMethodException::class);
$this->expectExceptionMessage('Method PHPUnit\TestFixture\MockObject\InterfaceWithNeverReturningMethod::m() is declared to never return');

$double->m();
}

#[TestDox('Original __clone() method is not called by default when test double object is cloned')]
public function testOriginalCloneMethodIsNotCalledByDefaultWhenTestDoubleObjectIsCloned(): void
{
Expand All @@ -223,16 +233,6 @@ public function testOriginalCloneMethodCanOptionallyBeCalledWhenTestDoubleObject
clone $double;
}

public function testThrowsExceptionWhenMethodWithNeverReturnTypeDeclarationIsCalled(): void
{
$double = $this->createTestDouble(InterfaceWithNeverReturningMethod::class);

$this->expectException(NeverReturningMethodException::class);
$this->expectExceptionMessage('Method PHPUnit\TestFixture\MockObject\InterfaceWithNeverReturningMethod::m() is declared to never return');

$double->m();
}

/**
* @psalm-template RealInstanceType of object
*
Expand Down

0 comments on commit 73798a8

Please sign in to comment.