Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
peripherad
/
back
/
vendor
/
phpdocumentor
/
reflection
/
tests
/
unit
/
phpDocumentor
/
Reflection
/
Php
:
MetadataContainerTestHelper.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php declare(strict_types=1); namespace phpDocumentor\Reflection\Php; use phpDocumentor\Reflection\Exception; use phpDocumentor\Reflection\Metadata\MetaDataContainer as MetaDataContainerInterface; trait MetadataContainerTestHelper { public function testSetMetaDataForNonExistingKey(): void { $stub = new MetadataStub('stub'); $this->getFixture()->addMetadata($stub); self::assertSame(['stub' => $stub], $this->getFixture()->getMetadata()); } public function testSetMetaDataWithExistingKeyThrows(): void { self::expectException(Exception::class); $stub = new MetadataStub('stub'); $this->getFixture()->addMetadata($stub); $this->getFixture()->addMetadata($stub); } abstract public function getFixture(): MetaDataContainerInterface; }