Neos\Flow\Tests\Unit\Persistence\Generic\SessionTest::isDirtyReturnsFalseForCleanArrays PHP Method

isDirtyReturnsFalseForCleanArrays() public method

    public function isDirtyReturnsFalseForCleanArrays()
    {
        $object = new \stdClass();
        $object->Persistence_Object_Identifier = 'cleanHash';
        $array = [];
        $array[] = $object;
        $className = 'Class' . md5(uniqid(mt_rand(), true));
        eval('class ' . $className . ' { public $array; }');
        $parent = new $className();
        $parent->array = $array;
        $cleanData = ['identifier' => 'fakeUuid', 'properties' => ['array' => ['type' => 'array', 'multivalue' => true, 'value' => [['type' => 'Some\\Object', 'index' => 0, 'value' => ['identifier' => 'cleanHash']]]]]];
        $session = $this->getMockBuilder(Persistence\Generic\Session::class)->setMethods(['getIdentifierByObject', 'isSingleValuedPropertyDirty'])->getMock();
        $session->registerReconstitutedEntity($parent, $cleanData);
        $session->expects($this->once())->method('getIdentifierByObject')->will($this->returnValue('fakeUuid'));
        $session->expects($this->once())->method('isSingleValuedPropertyDirty')->with('Some\\Object', ['identifier' => 'cleanHash'], $object)->will($this->returnValue(false));
        $this->assertFalse($session->isDirty($parent, 'array'));
    }