Skip to content

Commit

Permalink
Segregate legacy method test
Browse files Browse the repository at this point in the history
We would not want to mark the whole test as legacy.
  • Loading branch information
greg0ire committed Dec 16, 2017
1 parent c06f537 commit 983000d
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function getMethodParameters()
$methods = [];

foreach ($class->getMethods() as $method) {
if ($method->isConstructor() || $method->isStatic() || !$method->isPublic()) {
if ($method->isConstructor() || $method->isStatic() || !$method->isPublic() || $method->getName() === 'getHydrator') {
continue;
}

Expand Down Expand Up @@ -84,4 +84,20 @@ public function testAllMethodCallsAreDelegatedToTheWrappedInstance($method, arra

$this->assertSame($return, $decorator->$method(...$parameters));
}

/**
* @group legacy
*/
public function testGetHydratorCallIsDelegatedToTheWrappedInstance()
{
$this->wrapped->expects($this->once())
->method('getHydrator')
->with([$mode = 'some random mode'])
->willReturn($return = 'INNER VALUE FROM getHydrator');

$decorator = new class ($this->wrapped) extends EntityManagerDecorator {
};

$this->assertSame($return, $decorator->getHydrator([$mode]));
}
}

0 comments on commit 983000d

Please sign in to comment.