Neos\Flow\Tests\Unit\Persistence\Generic\SessionTest::isDirtyReturnsTrueForSplObjectStorageWhoseContainedObjectsDiffer PHP Метод

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

    public function isDirtyReturnsTrueForSplObjectStorageWhoseContainedObjectsDiffer()
    {
        $object = new \stdClass();
        $object->Persistence_Object_Identifier = 'dirtyUuid';
        $splObjectStorage = new \SplObjectStorage();
        $splObjectStorage->attach($object);
        $className = 'Class' . md5(uniqid(mt_rand(), true));
        eval('class ' . $className . ' { public $splObjectStorage; }');
        $parent = new $className();
        $parent->splObjectStorage = $splObjectStorage;
        $cleanData = ['identifier' => 'fakeUuid', 'properties' => ['splObjectStorage' => ['type' => 'SplObjectStorage', 'multivalue' => true, 'value' => [['value' => ['identifier' => 'cleanUuid']]]]]];
        $session = $this->getMockBuilder(Persistence\Generic\Session::class)->setMethods(['getIdentifierByObject'])->getMock();
        $session->registerReconstitutedEntity($parent, $cleanData);
        $session->expects($this->atLeastOnce())->method('getIdentifierByObject')->will($this->returnValue('fakeUuid'));
        $this->assertTrue($session->isDirty($parent, 'splObjectStorage'));
    }