Skip to content

Instantly share code, notes, and snippets.

@bramstroker
Created September 23, 2014 07:26
Show Gist options
  • Save bramstroker/74ec18a56e9bcd822bb0 to your computer and use it in GitHub Desktop.
Save bramstroker/74ec18a56e9bcd822bb0 to your computer and use it in GitHub Desktop.
<?php
$class = Mockery::mock('Doctrine\ORM\ClassMetadata');
include '/mypath/doctrine/orm/lib/Doctrine/ORM/Query.php';
?>
Now I get the following error message:
Fatal error: Cannot use Doctrine\ORM\Mapping\ClassMetadata as ClassMetadata because the name is already in use in Query.php on line 29
This line contains a namespace import:
use Doctrine\ORM\Mapping\ClassMetadata;
When I mock the ClassMetadata with the correct namespace I don't get a error
<?php
$class = Mockery::mock('Doctrine\ORM\Mapping\ClassMetadata');
include '/mypath/doctrine/orm/lib/Doctrine/ORM/Query.php';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment