/** * @test */ public function convertFromSetsRemovedContentShownContextPropertyFromConfigurationForContextPathSource() { $contextPath = '/foo/bar@user-demo'; $nodePath = '/foo/bar'; $mockNode = $this->setUpNodeWithNodeType($nodePath); $this->mockConverterConfiguration->expects($this->any())->method('getConfigurationValue')->with(NodeConverter::class, NodeConverter::REMOVED_CONTENT_SHOWN)->will($this->returnValue(true)); $result = $this->nodeConverter->convertFrom($contextPath, null, array(), $this->mockConverterConfiguration); $this->assertSame($mockNode, $result); $contextProperties = $mockNode->getContext()->getProperties(); $this->assertArrayHasKey('removedContentShown', $contextProperties, 'removedContentShown context property should be set'); $this->assertTrue($contextProperties['removedContentShown'], 'removedContentShown context property should be TRUE'); }
/** * @test * @dataProvider contentTypesBodiesAndExpectedUnifiedArguments */ public function convertTests($mediaType, $requestBody, array $expectedResult) { $this->mockPropertyMappingConfiguration->expects($this->atLeastOnce())->method('getConfigurationValue')->with(MediaTypeConverterInterface::class, MediaTypeConverterInterface::CONFIGURATION_MEDIA_TYPE)->will($this->returnValue($mediaType)); $actualResult = $this->mediaTypeConverter->convertFrom($requestBody, 'array', [], $this->mockPropertyMappingConfiguration); $this->assertSame($expectedResult, $actualResult); }