Neos\ContentRepository\Tests\Unit\Domain\Service\NodeServiceTest::setDefaultDateValueOnlyIfTheCurrentPropertyIsNull PHP Метод

setDefaultDateValueOnlyIfTheCurrentPropertyIsNull() публичный Метод

    public function setDefaultDateValueOnlyIfTheCurrentPropertyIsNull()
    {
        $nodeService = $this->createNodeService();
        $mockNode = $this->getMockBuilder(Node::class)->disableOriginalConstructor()->getMock();
        $mockNodeType = $this->mockNodeType('Neos.Neos:Content');
        $mockNode->expects($this->once())->method('getNodeType')->will($this->returnValue($mockNodeType));
        $mockNode->expects($this->once())->method('getProperty')->with('date')->will($this->returnValue(null));
        $mockNode->expects($this->once())->method('setProperty')->with('date', new \DateTime('2014-09-03'));
        $mockNodeType->expects($this->once())->method('getDefaultValuesForProperties')->will($this->returnValue(array('date' => new \DateTime('2014-09-03'))));
        $nodeService->setDefaultValues($mockNode);
    }