Update message.
This commit is contained in:
parent
f9a605f6ca
commit
e37041aa94
@ -860,7 +860,13 @@ use Doctrine\Common\Util\ClassUtils;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( ! $connection instanceof Connection) {
|
if ( ! $connection instanceof Connection) {
|
||||||
throw new \InvalidArgumentException(sprintf('Invalid argument for connection "%s".', is_object($connection) ? get_class($connection) : gettype($connection) . '#' . $connection));
|
throw new \InvalidArgumentException(
|
||||||
|
sprintf(
|
||||||
|
'Invalid $connection argument of type %s given%s.',
|
||||||
|
is_object($connection) ? get_class($connection) : gettype($connection),
|
||||||
|
is_object($connection) ? '' : ': "' . $connection . '"'
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($eventManager !== null && $connection->getEventManager() !== $eventManager) {
|
if ($eventManager !== null && $connection->getEventManager() !== $eventManager) {
|
||||||
|
@ -208,12 +208,11 @@ class EntityManagerTest extends OrmTestCase
|
|||||||
return 'callback';
|
return 'callback';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException \InvalidArgumentException
|
|
||||||
* @expectedExceptionMessageRegExp /^Invalid argument for connection \"integer#1\".$/
|
|
||||||
*/
|
|
||||||
public function testCreateInvalidConnection()
|
public function testCreateInvalidConnection()
|
||||||
{
|
{
|
||||||
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
|
$this->expectExceptionMessageRegExp('/^Invalid \$connection argument of type integer given: \"1\".$/');
|
||||||
|
|
||||||
$config = new Configuration();
|
$config = new Configuration();
|
||||||
$config->setMetadataDriverImpl($this->createMock(MappingDriver::class));
|
$config->setMetadataDriverImpl($this->createMock(MappingDriver::class));
|
||||||
EntityManager::create(1, $config);
|
EntityManager::create(1, $config);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user