DummyExtractor example

use Symfony\Component\PropertyInfo\Type;

/** * @author Dmitrii Poddubnyi <dpoddubny@gmail.com> */
class ConstructorExtractorTest extends TestCase
{
    private ConstructorExtractor $extractor;

    protected function setUp(): void
    {
        $this->extractor = new ConstructorExtractor([new DummyExtractor()]);
    }

    public function testInstanceOf()
    {
        $this->assertInstanceOf(\Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface::class$this->extractor);
    }

    public function testGetTypes()
    {
        $this->assertEquals([new Type(Type::BUILTIN_TYPE_STRING)]$this->extractor->getTypes('Foo', 'bar', []));
    }

    
use Symfony\Component\PropertyInfo\Type;

/** * @author Kévin Dunglas <dunglas@gmail.com> */
class AbstractPropertyInfoExtractorTest extends TestCase
{
    protected PropertyInfoExtractorInterface $propertyInfo;

    protected function setUp(): void
    {
        $extractors = [new NullExtractor()new DummyExtractor()];
        $this->propertyInfo = new PropertyInfoExtractor($extractors$extractors$extractors$extractors$extractors);
    }

    public function testInstanceOf()
    {
        $this->assertInstanceOf(PropertyInfoExtractorInterface::class$this->propertyInfo);
        $this->assertInstanceOf(PropertyTypeExtractorInterface::class$this->propertyInfo);
        $this->assertInstanceOf(PropertyDescriptionExtractorInterface::class$this->propertyInfo);
        $this->assertInstanceOf(PropertyAccessExtractorInterface::class$this->propertyInfo);
        $this->assertInstanceOf(PropertyInitializableExtractorInterface::class$this->propertyInfo);
    }

    
Home | Imprint | This part of the site doesn't use cookies.