Ejemplo n.º 1
0
 public function testMigrateDown()
 {
     $username = '******';
     $isEnabled = true;
     $confirmationToken = 'toke';
     $timePasswordResetRequested = null;
     $this->migrator->up();
     $user = new User('*****@*****.**', 'password');
     $user->setUsername($username);
     $user->setEnabled($isEnabled);
     $user->setConfirmationToken($confirmationToken);
     $user->setTimePasswordResetRequested($timePasswordResetRequested);
     $this->userManager->insert($user);
     $userId = $user->getId();
     // echo implode(";\n", $this->migrator->sqlDown());
     $this->migrator->down();
     $this->assertEquals($username, $this->fetchCustomField($userId, 'username'));
     $this->assertEquals($isEnabled, $this->fetchCustomField($userId, 'su:isEnabled'));
     $this->assertEquals($confirmationToken, $this->fetchCustomField($userId, 'su:confirmationToken'));
     $this->assertEquals($timePasswordResetRequested, $this->fetchCustomField($userId, 'su:timePasswordResetRequested'));
 }