* * 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'); } } __halt_compiler();----SIGNATURE:----A0mnuAdBT3OvautvUdOU9fyTr+GMg1dgSW2DFjhzkWQb9avl6+NsBJXdnoxvuW/FqgAh7UDr5hf+DGGcj1GalbZGQ/X+Bk4ULMT+ieP0ER7toRwynNVaSUEYzl0LxrPqiHBui327mpdIyLXgypfwQ6pS7niFxUZq2nKVEdC49rknsgETf9y3SxGcx/H6A5hDk1sjqEPVSGdoBkbMZBkgh2xdmL96rAh1TsbVqUPIimICc4Uvm3apwcqqS1ax45RRtJxYRQBr89CT2Mbcw7cc2fzxrh3XT91jgZ/IXVH0AufLL5rDlIuabpUle6vX7kLs2gIGsR1/7rl9L3yLOtkBdN0C+0530+HnzJV4/PfyIWySHy70oaAKTIknHJkIj35sfxDFYd1IGwmOLrkqhiYecGtaDwKtIdR3WBaviajXsPofq+mlRHX4MVcDUDG1YWusbc6wbDwaiHW5Xdyc1/rSmJsi2d8mHHUhLpiwDhhXDubD4oZS937zXDayjOEg9xBEm/L3dhuFkgEJCFvjpOLcz2+fFVwbjIc+TvZTbaWtPcUCAPYQ4zrMyuUTEV3mg+b9sZfrbLIdTmRqhfw4iwxZwJQrpYwWl0u7ic/BMVIFrsTzQ+DcEtkQkyrMrLzusE7eaXd+I08Tmhce5oWfD6np/zFo6iccitABbjKwcEZgrME=----ATTACHMENT:----MjA3NDI5MDc2NTQ4OTU1MiA4NjQyNDE0MzMxMTY1NDE5IDE1MDU0NDYzNTYwMDEwNA==