Update Composer, update everything

This commit is contained in:
Oliver Davies 2018-11-23 12:29:20 +00:00
parent ea3e94409f
commit dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions

View file

@ -0,0 +1,79 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Validator\Tests\Mapping\Cache;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Validator\Mapping\Cache\CacheInterface;
use Symfony\Component\Validator\Mapping\ClassMetadata;
abstract class AbstractCacheTest extends TestCase
{
/**
* @var CacheInterface
*/
protected $cache;
public function testWrite()
{
$meta = $this->getMockBuilder(ClassMetadata::class)
->disableOriginalConstructor()
->setMethods(array('getClassName'))
->getMock();
$meta->expects($this->once())
->method('getClassName')
->will($this->returnValue('Foo\\Bar'));
$this->cache->write($meta);
$this->assertInstanceOf(
ClassMetadata::class,
$this->cache->read('Foo\\Bar'),
'write() stores metadata'
);
}
public function testHas()
{
$meta = $this->getMockBuilder(ClassMetadata::class)
->disableOriginalConstructor()
->setMethods(array('getClassName'))
->getMock();
$meta->expects($this->once())
->method('getClassName')
->will($this->returnValue('Foo\\Bar'));
$this->assertFalse($this->cache->has('Foo\\Bar'), 'has() returns false when there is no entry');
$this->cache->write($meta);
$this->assertTrue($this->cache->has('Foo\\Bar'), 'has() returns true when the is an entry');
}
public function testRead()
{
$meta = $this->getMockBuilder(ClassMetadata::class)
->disableOriginalConstructor()
->setMethods(array('getClassName'))
->getMock();
$meta->expects($this->once())
->method('getClassName')
->will($this->returnValue('Foo\\Bar'));
$this->assertFalse($this->cache->read('Foo\\Bar'), 'read() returns false when there is no entry');
$this->cache->write($meta);
$this->assertInstanceOf(ClassMetadata::class, $this->cache->read('Foo\\Bar'), 'read() returns metadata');
}
}

View file

@ -0,0 +1,23 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Validator\Tests\Mapping\Cache;
use Doctrine\Common\Cache\ArrayCache;
use Symfony\Component\Validator\Mapping\Cache\DoctrineCache;
class DoctrineCacheTest extends AbstractCacheTest
{
protected function setUp()
{
$this->cache = new DoctrineCache(new ArrayCache());
}
}

View file

@ -0,0 +1,26 @@
<?php
namespace Symfony\Component\Validator\Tests\Mapping\Cache;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\Validator\Mapping\Cache\Psr6Cache;
use Symfony\Component\Validator\Mapping\ClassMetadata;
/**
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class Psr6CacheTest extends AbstractCacheTest
{
protected function setUp()
{
$this->cache = new Psr6Cache(new ArrayAdapter());
}
public function testNameCollision()
{
$metadata = new ClassMetadata('Foo\\Bar');
$this->cache->write($metadata);
$this->assertFalse($this->cache->has('Foo_Bar'));
}
}