Skip to content
Snippets Groups Projects
Commit 3167528b authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

dev #56994 : final matching rule + fix after real run

parent 3c869c77
5 merge requests!2080Sandbox detach zf from storm,!2061Master,!2060Master,!2059Hotline master,!2056Dev#56994 migration des comptes lecteurs chambery
Pipeline #621 passed with stage
in 12 minutes and 37 seconds
......@@ -125,6 +125,7 @@ class Class_User_DatasRelationAvisNotice extends Class_User_DatasRelation {
parent::giveFromTo($from, $to);
$this->getSql()
->query('update notice_avis set user_key=\'' . Class_AvisNotice::keyForUser($to) . '\' where id_user=' . $to->getId());
->query(sprintf('update %s set user_key=\'' . Class_AvisNotice::keyForUser($to) . '\' where %s=' . $to->getId(),
$this->getTable(), $this->getKey()));
}
}
......@@ -112,7 +112,19 @@ foreach(Class_Users::findAllBy(['statut' => 1, 'role_level' => 2]) as $user) {
continue;
}
if (!$target = $datas->giveTo(['login' => 'CHAM' . $user->getLogin(),
if ('CHAM' != substr(strtoupper($user->getLogin()), 0, 4)) {
$no_target_log->write([$user->getId(),
$user->getLogin(),
$user->getNom(),
$user->getPrenom(),
$user->getNaissance(),
'Card does not starts with CHAM']);
$without_target++;
echo 'F';
continue;
}
if (!$target = $datas->giveTo(['login' => substr($user->getLogin(), 4),
'statut' => 0,
'role_level' => 2],
$for_real)) {
......
......@@ -109,7 +109,7 @@ class UserDatasTest extends UserDatasTestCase {
->answers(1);
$this->_sql->whenCalled('query')
->with('update notice_avis set user_key=\'--0--actarus\' where id_user=45')
->with('update notices_avis set user_key=\'--0--actarus\' where id_user=45')
->answers(1);
$this->assertEquals(45,
......@@ -123,7 +123,7 @@ class UserDatasTest extends UserDatasTestCase {
$this
->assertTrue($this->_sql
->methodHasBeenCalledWithParams('query',
['update notice_avis set user_key=\'--0--actarus\' where id_user=45']));
['update notices_avis set user_key=\'--0--actarus\' where id_user=45']));
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment