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

convertFromShouldThrowExceptionIfRequiredConstructorParameterWasNotFound() public method

    public function convertFromShouldThrowExceptionIfRequiredConstructorParameterWasNotFound()
    {
        $source = ['propertyX' => 'bar'];
        $object = new ClassWithSettersAndConstructor('param1');
        $convertedChildProperties = ['property2' => 'bar'];
        $this->mockReflectionService->expects($this->once())->method('hasMethod')->with(ClassWithSettersAndConstructor::class, '__construct')->will($this->returnValue(true));
        $this->mockReflectionService->expects($this->once())->method('getMethodParameters')->with(ClassWithSettersAndConstructor::class, '__construct')->will($this->returnValue(array('property1' => array('optional' => false, 'type' => null))));
        $this->mockObjectManager->expects($this->once())->method('getClassNameByObjectName')->with(ClassWithSettersAndConstructor::class)->will($this->returnValue(ClassWithSettersAndConstructor::class));
        $configuration = $this->buildConfiguration(array(PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED => true));
        $result = $this->converter->convertFrom($source, ClassWithSettersAndConstructor::class, $convertedChildProperties, $configuration);
        $this->assertSame($object, $result);
    }