rehash example

$source->setModuleHandler($module_handler->reveal());

    // Ensure we don't log this to the mapping table.     $this->idMap->expects($this->never())
      ->method('saveIdMapping');

    $this->assertTrue($source->prepareRow($row));

    // Track_changes...     $source = new StubSourcePlugin(['track_changes' => TRUE], '', []$migration);
    $row2 = $this->prophesize(Row::class);
    $row2->rehash()
      ->shouldBeCalled();
    $module_handler->invokeAll('migrate_prepare_row', [$row2$source$migration])
      ->willReturn([TRUE, TRUE])
      ->shouldBeCalled();
    $module_handler->invokeAll('migrate_' . $migration->id() . '_prepare_row', [$row2$source$migration])
      ->willReturn([TRUE, TRUE])
      ->shouldBeCalled();
    $source->setModuleHandler($module_handler->reveal());
    $this->assertTrue($source->prepareRow($row2->reveal()));
  }

  
$encoderName = $resultIdentity['encoder'];
            $plaintext = $this->_credential;
            $hash = $resultIdentity[$this->_credentialColumn];

            $passwordValid = Shopware()->PasswordEncoder()->isPasswordValid($plaintext$hash$encoderName);
            if ($passwordValid) {
                $defaultEncoderName = Shopware()->PasswordEncoder()->getDefaultPasswordEncoderName();

                if ($encoderName !== $defaultEncoderName) {
                    $this->updateHash($plaintext$defaultEncoderName);
                } else {
                    $this->rehash($plaintext$hash$encoderName);
                }
            }
        }

        if (!$passwordValid) {
            $this->_authenticateResultInfo['code'] = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;
            $this->_authenticateResultInfo['messages'][] = 'Supplied credential is invalid.';

            return $this->_authenticateCreateAuthResult();
        }

        
$this->idMap->saveIdMapping($row[], MigrateIdMapInterface::STATUS_IGNORED);
        $this->currentRow = NULL;
        $this->currentSourceIds = NULL;
      }
      $result = FALSE;
    }
    elseif ($this->trackChanges) {
      // When tracking changed data, We want to quietly skip (rather than       // "ignore") rows with changes. The caller needs to make that decision,       // so we need to provide them with the necessary information (before and       // after hashes).       $row->rehash();
    }
    return $result;
  }

  /** * Returns the iterator that will yield the row arrays to be processed. * * @return \Iterator * The iterator that will yield the row arrays to be processed. */
  protected function getIterator() {
    
'title' => 'node X',
    ];
    $this->expectException(\Exception::class);
    new Row($invalid_values$this->testSourceIds);
  }

  /** * Tests source immutability after freeze. */
  public function testSourceFreeze() {
    $row = new Row($this->testValues, $this->testSourceIds);
    $row->rehash();
    $this->assertSame($this->testHash, $row->getHash(), 'Correct hash.');
    $row->setSourceProperty('title', 'new title');
    $row->rehash();
    $this->assertSame($this->testHashMod, $row->getHash(), 'Hash changed correctly.');
    $row->freezeSource();
    $this->expectException(\Exception::class);
    $row->setSourceProperty('title', 'new title');
  }

  /** * Tests setting on a frozen row. */
Home | Imprint | This part of the site doesn't use cookies.