New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting error when stubbing Doctrine\ORM\Query\Filter\SQLFilter #92
Comments
Can you tell us the version of Prophecy you are using ? |
name : phpspec/prophecy
descrip. : Highly opinionated mocking framework for PHP 5.3+
keywords : Double, Dummy, fake, mock, spy, stub
versions : * 1.1.2
type : library
license : MIT
source : [git] https://github.com/phpspec/prophecy.git 976a65af02a2a0e17ce6c949f7b43437205628bb
dist : [zip] https://api.github.com/repos/phpspec/prophecy/zipball/976a65af02a2a0e17ce6c949f7b43437205628bb 976a65af02a2a0e17ce6c949f7b43437205628bb
names : phpspec/prophecy |
@stof I get the same error with the dev-master version. |
Actually, could you try #54 (comment) ? |
After doing some debug, it only work when I comment this line DisableConstructorPatch#L45 (#30) What do you propose to solve this issue ? |
Could it be resolved by leting the classMirror looking at private final methods too ? Actually it doesn't verify if final because it's not public. |
Is there a good solution for this? I too have to stub a This is the code I use: function it_sets_workspace_parameter_on_workspace_filter_when_there_is_a_workspace(
FilterControllerEvent $event,
$entityManager,
$workspaceContext,
WorkspaceInterface $workspace,
FilterCollection $filterCollection,
WorkspaceFilter $workspaceFilter
) {
$workspaceFilter->beConstructedWith([$entityManager]);
$event->getRequestType()->willReturn(HttpKernelInterface::MASTER_REQUEST);
$workspaceContext->getWorkspace()
->shouldBeCalled()
->willReturn($workspace)
;
$entityManager->getFilters()
->shouldBeCalled()
->willReturn($filterCollection)
;
$filterCollection->getFilter('workspace')
->shouldBeCalled()
->willReturn($workspaceFilter)
;
$workspace->getId()
->shouldBeCalled()
->willReturn(42)
;
$workspaceFilter->setParameter('workspace_id', 42)
->shouldBeCalled()
;
$this->onKernelController($event);
} No matter what I try, I keep getting:
|
PHP Fatal error: Cannot override final method Doctrine\ORM\Query\Filter\SQLFilter::__construct() in /home/a-aitboudad/www/isobar/mixa/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php(48) : eval()'d code on line 2
The text was updated successfully, but these errors were encountered: