Neos\Flow\Tests\Unit\Property\TypeConverter\PersistentObjectConverterTest::getTypeOfChildPropertyShouldConsiderSetters PHP Method

getTypeOfChildPropertyShouldConsiderSetters() public method

    public function getTypeOfChildPropertyShouldConsiderSetters()
    {
        $mockSchema = $this->getMockBuilder(ClassSchema::class)->disableOriginalConstructor()->getMock();
        $this->mockReflectionService->expects($this->any())->method('getClassSchema')->with('TheTargetType')->will($this->returnValue($mockSchema));
        $mockSchema->expects($this->any())->method('hasProperty')->with('virtualPropertyName')->will($this->returnValue(false));
        $this->mockReflectionService->expects($this->any())->method('hasMethod')->with('TheTargetType', 'setVirtualPropertyName')->will($this->returnValue(true));
        $this->mockReflectionService->expects($this->any())->method('getMethodParameters')->will($this->returnValueMap([['TheTargetType', '__construct', []], ['TheTargetType', 'setVirtualPropertyName', [['type' => 'TheTypeOfSubObject']]]]));
        $this->mockReflectionService->expects($this->any())->method('hasMethod')->with('TheTargetType', 'setVirtualPropertyName')->will($this->returnValue(true));
        $this->mockReflectionService->expects($this->exactly(2))->method('getMethodParameters')->withConsecutive([$this->equalTo('TheTargetType'), $this->equalTo('__construct')], [$this->equalTo('TheTargetType'), $this->equalTo('setVirtualPropertyName')])->will($this->returnValue([['type' => 'TheTypeOfSubObject']]));
        $configuration = $this->buildConfiguration([]);
        $this->assertEquals('TheTypeOfSubObject', $this->converter->getTypeOfChildProperty('TheTargetType', 'virtualPropertyName', $configuration));
    }