#6441 moving expected exception annotations into explicit method calls
This commit is contained in:
parent
94640aca88
commit
5770459bfc
@ -228,10 +228,6 @@ class DefaultCacheFactoryTest extends OrmTestCase
|
|||||||
$this->assertNotSame($cachedPersister1->getCacheRegion(), $cachedPersister2->getCacheRegion());
|
$this->assertNotSame($cachedPersister1->getCacheRegion(), $cachedPersister2->getCacheRegion());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException InvalidArgumentException
|
|
||||||
* @expectedExceptionMessage Unrecognized access strategy type [-1]
|
|
||||||
*/
|
|
||||||
public function testBuildCachedEntityPersisterNonStrictException()
|
public function testBuildCachedEntityPersisterNonStrictException()
|
||||||
{
|
{
|
||||||
$em = $this->em;
|
$em = $this->em;
|
||||||
@ -240,13 +236,12 @@ class DefaultCacheFactoryTest extends OrmTestCase
|
|||||||
|
|
||||||
$metadata->cache['usage'] = -1;
|
$metadata->cache['usage'] = -1;
|
||||||
|
|
||||||
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
|
$this->expectExceptionMessage('Unrecognized access strategy type [-1]');
|
||||||
|
|
||||||
$this->factory->buildCachedEntityPersister($em, $persister, $metadata);
|
$this->factory->buildCachedEntityPersister($em, $persister, $metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException InvalidArgumentException
|
|
||||||
* @expectedExceptionMessage Unrecognized access strategy type [-1]
|
|
||||||
*/
|
|
||||||
public function testBuildCachedCollectionPersisterException()
|
public function testBuildCachedCollectionPersisterException()
|
||||||
{
|
{
|
||||||
$em = $this->em;
|
$em = $this->em;
|
||||||
@ -256,17 +251,23 @@ class DefaultCacheFactoryTest extends OrmTestCase
|
|||||||
|
|
||||||
$mapping['cache']['usage'] = -1;
|
$mapping['cache']['usage'] = -1;
|
||||||
|
|
||||||
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
|
$this->expectExceptionMessage('Unrecognized access strategy type [-1]');
|
||||||
|
|
||||||
$this->factory->buildCachedCollectionPersister($em, $persister, $mapping);
|
$this->factory->buildCachedCollectionPersister($em, $persister, $mapping);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException LogicException
|
|
||||||
* @expectedExceptionMessage If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" is required, The default implementation provided by doctrine is "Doctrine\ORM\Cache\Region\FileLockRegion" if you want to use it please provide a valid directory
|
|
||||||
*/
|
|
||||||
public function testInvalidFileLockRegionDirectoryException()
|
public function testInvalidFileLockRegionDirectoryException()
|
||||||
{
|
{
|
||||||
$factory = new DefaultCacheFactory($this->regionsConfig, $this->getSharedSecondLevelCacheDriverImpl());
|
$factory = new DefaultCacheFactory($this->regionsConfig, $this->getSharedSecondLevelCacheDriverImpl());
|
||||||
|
|
||||||
|
$this->expectException(\LogicException::class);
|
||||||
|
$this->expectExceptionMessage(
|
||||||
|
'If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" '
|
||||||
|
. 'is required, The default implementation provided by doctrine is '
|
||||||
|
. '"Doctrine\ORM\Cache\Region\FileLockRegion" if you want to use it please provide a valid directory'
|
||||||
|
);
|
||||||
|
|
||||||
$factory->getRegion(
|
$factory->getRegion(
|
||||||
[
|
[
|
||||||
'usage' => ClassMetadata::CACHE_USAGE_READ_WRITE,
|
'usage' => ClassMetadata::CACHE_USAGE_READ_WRITE,
|
||||||
@ -275,16 +276,19 @@ class DefaultCacheFactoryTest extends OrmTestCase
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException LogicException
|
|
||||||
* @expectedExceptionMessage If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" is required, The default implementation provided by doctrine is "Doctrine\ORM\Cache\Region\FileLockRegion" if you want to use it please provide a valid directory
|
|
||||||
*/
|
|
||||||
public function testInvalidFileLockRegionDirectoryExceptionWithEmptyString()
|
public function testInvalidFileLockRegionDirectoryExceptionWithEmptyString()
|
||||||
{
|
{
|
||||||
$factory = new DefaultCacheFactory($this->regionsConfig, $this->getSharedSecondLevelCacheDriverImpl());
|
$factory = new DefaultCacheFactory($this->regionsConfig, $this->getSharedSecondLevelCacheDriverImpl());
|
||||||
|
|
||||||
$factory->setFileLockRegionDirectory('');
|
$factory->setFileLockRegionDirectory('');
|
||||||
|
|
||||||
|
$this->expectException(\LogicException::class);
|
||||||
|
$this->expectExceptionMessage(
|
||||||
|
'If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" '
|
||||||
|
. 'is required, The default implementation provided by doctrine is '
|
||||||
|
. '"Doctrine\ORM\Cache\Region\FileLockRegion" if you want to use it please provide a valid directory'
|
||||||
|
);
|
||||||
|
|
||||||
$factory->getRegion(
|
$factory->getRegion(
|
||||||
[
|
[
|
||||||
'usage' => ClassMetadata::CACHE_USAGE_READ_WRITE,
|
'usage' => ClassMetadata::CACHE_USAGE_READ_WRITE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user