Skip to content

Commit

Permalink
add missing tests for non existing traits
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl authored and sebastianbergmann committed Sep 8, 2019
1 parent c1117fc commit 14b5e16
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/unit/Framework/MockObject/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,19 @@ public function testGetMockForTraitStubbingAbstractMethod(): void
$this->assertTrue(\method_exists($mock, 'doSomething'));
}

public function testGetMockForSingletonWithReflectionSuccess(): void
public function testGetMockForTraitWithNonExistantTrait(): void
{
$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$mock = $this->generator->getMockForTrait('NonExistantTrait');
}

public function testGetObjectForTraitWithNonExistantTrait(): void
{
$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$mock = $this->generator->getObjectForTrait('NonExistantTrait');
}

public function testGetMockForSingletonWithReflectionSuccess(): void
{
$mock = $this->generator->getMock(SingletonClass::class, ['doSomething'], [], '', false);

Expand Down

0 comments on commit 14b5e16

Please sign in to comment.