From cb98373b4776587da6986c4116e59edd46b3415f Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 14:19:27 -0400 Subject: [PATCH 01/28] adding mysql 5.7 install in travis --- .travis.install-mysql-5.7.sh | 6 ++++++ .travis.yml | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 .travis.install-mysql-5.7.sh diff --git a/.travis.install-mysql-5.7.sh b/.travis.install-mysql-5.7.sh new file mode 100644 index 00000000000..783c5bb068f --- /dev/null +++ b/.travis.install-mysql-5.7.sh @@ -0,0 +1,6 @@ +echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections +wget http://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb +sudo dpkg --install mysql-apt-config_0.7.3-1_all.deb +sudo apt-get update -q +sudo apt-get install -q -y -o Dpkg::Options::=--force-confnew mysql-server +sudo mysql_upgrade diff --git a/.travis.yml b/.travis.yml index 7f7940e4bbd..7464ba463f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,6 +56,8 @@ before_script: - mkdir -p project smarty/templates_c - chmod 777 smarty/templates_c + - bash .travis.install-mysql-5.7.sh + # Set up the MySQL database, install the Schema, create a MySQL user # for the config file, and reset the Loris user's password for testing - mysql -e 'CREATE DATABASE LorisTest' From 8477f2e2997cff7db51ddc1efed6a223282e1a7e Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 14:23:54 -0400 Subject: [PATCH 02/28] allow sudo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7464ba463f7..bc865d5482b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ php: - "5.6" - "7" -sudo: false +sudo: true addons: firefox: "44.0" From 189fa0eebd04e45401f44d9bd3b19dfed4892821 Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 14:56:14 -0400 Subject: [PATCH 03/28] fix error 1-9 --- modules/conflict_resolver/test/conflict_resolverTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/conflict_resolver/test/conflict_resolverTest.php b/modules/conflict_resolver/test/conflict_resolverTest.php index ebfa3bdd76d..6a778abd08a 100644 --- a/modules/conflict_resolver/test/conflict_resolverTest.php +++ b/modules/conflict_resolver/test/conflict_resolverTest.php @@ -55,7 +55,6 @@ function setUp() 'OldValue1' => 'Mother', 'OldValue2' => 'Father', 'NewValue' => 'NULL', - 'ConflictID' => 'NULL', ) ); $this->DB->insert( From 885e62cec8412aa8784b0ac08ad0231f86d76f29 Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 14:58:49 -0400 Subject: [PATCH 04/28] fix error 10-13 --- modules/dashboard/test/DashboardTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dashboard/test/DashboardTest.php b/modules/dashboard/test/DashboardTest.php index 1eeb2cca3ab..032d2b25195 100644 --- a/modules/dashboard/test/DashboardTest.php +++ b/modules/dashboard/test/DashboardTest.php @@ -57,7 +57,7 @@ function setUp() array( 'CenterID' => '55', 'Name' => 'TESTinPSC', - 'Alias' => 'test', + 'Alias' => 'tst', 'MRI_alias' => 'test', ) ); From d589da6c027b8fef5c5cd7feeb24b0306b0d46e1 Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 15:03:23 -0400 Subject: [PATCH 05/28] fix error 14-19 --- modules/dicom_archive/test/dicom_archiveTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/dicom_archive/test/dicom_archiveTest.php b/modules/dicom_archive/test/dicom_archiveTest.php index 264011ae674..bb74b4cbd73 100644 --- a/modules/dicom_archive/test/dicom_archiveTest.php +++ b/modules/dicom_archive/test/dicom_archiveTest.php @@ -68,6 +68,7 @@ function setUp() 'SessionID' => '44', 'uploadAttempt' => '0', 'CreateInfo' => 'NULL', + 'AcquisitionMetadata' => 'A really long text that can not be null.' ) ); } From b7bf6bc7a6baac9ba62e12f91695264eda85f990 Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 15:05:24 -0400 Subject: [PATCH 06/28] fix error 20-24 --- modules/document_repository/test/document_repositoryTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/document_repository/test/document_repositoryTest.php b/modules/document_repository/test/document_repositoryTest.php index 82b78145183..38b2692e5da 100644 --- a/modules/document_repository/test/document_repositoryTest.php +++ b/modules/document_repository/test/document_repositoryTest.php @@ -50,7 +50,6 @@ public function setUp() 'uploaded_by' => 'admin', 'For_site' => '3', 'comments' => 'tester', - 'multipart' => 'NULL', 'EARLI' => '0', 'hide_video' => '0', 'File_category' => '9999999', From d73195049bcb076a7785503f0145fbeab36d1380 Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 15:07:09 -0400 Subject: [PATCH 07/28] fix error 25-33 --- modules/examiner/test/ExaminerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/examiner/test/ExaminerTest.php b/modules/examiner/test/ExaminerTest.php index b54c7a4a9c1..ab67585e6c3 100644 --- a/modules/examiner/test/ExaminerTest.php +++ b/modules/examiner/test/ExaminerTest.php @@ -43,7 +43,7 @@ public function setUp() $this->DB->insert( "psc", array( - 'CenterID' => '9999999', + 'CenterID' => '99', 'Name' => 'TEST_Site', 'Study_site' => 'Y', 'StateID' => '0', From 59a988befa4c7aafbdfebadd6e312decd5db170c Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 15:12:42 -0400 Subject: [PATCH 08/28] phpcs --- modules/dicom_archive/test/dicom_archiveTest.php | 2 +- .../test/document_repositoryTest.php | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/dicom_archive/test/dicom_archiveTest.php b/modules/dicom_archive/test/dicom_archiveTest.php index bb74b4cbd73..c31bc2ce542 100644 --- a/modules/dicom_archive/test/dicom_archiveTest.php +++ b/modules/dicom_archive/test/dicom_archiveTest.php @@ -68,7 +68,7 @@ function setUp() 'SessionID' => '44', 'uploadAttempt' => '0', 'CreateInfo' => 'NULL', - 'AcquisitionMetadata' => 'A really long text that can not be null.' + 'AcquisitionMetadata' => 'A really long text that can not be null.', ) ); } diff --git a/modules/document_repository/test/document_repositoryTest.php b/modules/document_repository/test/document_repositoryTest.php index 38b2692e5da..4afed856608 100644 --- a/modules/document_repository/test/document_repositoryTest.php +++ b/modules/document_repository/test/document_repositoryTest.php @@ -27,7 +27,7 @@ public function setUp() { parent::setUp(); $window = new WebDriverWindow($this->webDriver); - $size = new WebDriverDimension(1024,1768); + $size = new WebDriverDimension(1024, 1768); $window->setSize($size); $this->DB->insert( "document_repository_categories", @@ -153,7 +153,8 @@ function testDocumentRepositoryCreateCategory() $this->safeFindElement(WebDriverBy::Id("postCategory"))->click(); sleep(10); $this->safeFindElement( - WebDriverBy::Xpath("//*[@id='TestTestTesta']/td/span"),3000 + WebDriverBy::Xpath("//*[@id='TestTestTesta']/td/span"), + 3000 ) ->click(); $test = $this->safeFindElement(WebDriverBy::Id("testa")) @@ -172,7 +173,8 @@ function testDocumentRepositoryUploadFile() $this->markTestSkipped("This method isn't working properly on travis."); $this->safeGet($this->url . "/document_repository/"); $this->safeFindElement( - WebDriverBy::Xpath("//*[@id='TESTTESTTESTTESTa']/td/span"),3000 + WebDriverBy::Xpath("//*[@id='TESTTESTTESTTESTa']/td/span"), + 3000 ) ->click(); $test = $this->safeFindElement(WebDriverBy::linkText("README.md")) @@ -186,7 +188,8 @@ function testDocumentRepositoryUploadFile() * @return void */ function testDocumentRepositoryUploadFileEditDeleteComment() - { $this->markTestSkipped("This method isn't working properly on travis."); + { + $this->markTestSkipped("This method isn't working properly on travis."); $this->safeGet($this->url . "/document_repository/"); $this->safeFindElement( WebDriverBy::Xpath("//*[@id='TESTTESTTESTTESTa']/td/span") From 5623c3d79bcb230fc016b62f4efe3a5eae4c422c Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 15:35:10 -0400 Subject: [PATCH 09/28] fix error 34-37 --- modules/help_editor/test/help_editorTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/help_editor/test/help_editorTest.php b/modules/help_editor/test/help_editorTest.php index d674d70174f..9fb0a8cfae9 100644 --- a/modules/help_editor/test/help_editorTest.php +++ b/modules/help_editor/test/help_editorTest.php @@ -45,7 +45,6 @@ function setUp() 'topic' => 'Test Topic', 'content' => 'This is a test content.', 'created' => '2013-04-05 00:00:00', - 'updated' => 'NULL', ) ); } From 1b4650290f3aa444ab262323037d05c584d12903 Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 15:39:59 -0400 Subject: [PATCH 10/28] fix error 38-53 --- modules/imaging_browser/test/imaging_browserTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/imaging_browser/test/imaging_browserTest.php b/modules/imaging_browser/test/imaging_browserTest.php index db05e37b15f..d719fb020cc 100644 --- a/modules/imaging_browser/test/imaging_browserTest.php +++ b/modules/imaging_browser/test/imaging_browserTest.php @@ -243,7 +243,7 @@ public function setUp() 'QCStatus' => null, 'QCFirstChangeTime' => 1455040145, 'QCLastChangeTime' => 1455040145, - 'Selected' => 't2' + 'Selected' => true ) ); @@ -258,7 +258,7 @@ public function setUp() 'QCStatus' => null, 'QCFirstChangeTime' => 1455040145, 'QCLastChangeTime' => 1455040145, - 'Selected' => 't1' + 'Selected' => true ) ); @@ -1285,4 +1285,4 @@ function testImageCommentsWindowEditable() $this->webDriver->switchTo()->window($diff[1])->close(); } } -?> \ No newline at end of file +?> From e489a8dc3705f34317bf2b7e19666edaa15c4628 Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 15:42:09 -0400 Subject: [PATCH 11/28] fix error 54-63 --- modules/mri_violations/test/mri_violationsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mri_violations/test/mri_violationsTest.php b/modules/mri_violations/test/mri_violationsTest.php index 2a1ffbd065a..3f9308c6e12 100644 --- a/modules/mri_violations/test/mri_violationsTest.php +++ b/modules/mri_violations/test/mri_violationsTest.php @@ -31,7 +31,7 @@ public function setUp() array( 'CenterID' => '55', 'Name' => 'TESTinPSC', - 'Alias' => 'test', + 'Alias' => 'tst', 'MRI_alias' => 'test' ) From 9aa801002d3b49a8c3efc9644ba91e22f5356275 Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 15:45:02 -0400 Subject: [PATCH 12/28] fix error 66-69 --- modules/reliability/test/reliabilityTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/reliability/test/reliabilityTest.php b/modules/reliability/test/reliabilityTest.php index bb2fa4eb11b..dccbce29e37 100644 --- a/modules/reliability/test/reliabilityTest.php +++ b/modules/reliability/test/reliabilityTest.php @@ -37,7 +37,7 @@ public function setUp() array( 'CenterID' => '55', 'Name' => 'TESTinPSC', - 'Alias' => 'test', + 'Alias' => 'tst', 'MRI_alias' => 'test' ) From a9c10d5ff4b1ad60c894830b05fa20fc98c94de3 Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 15:47:20 -0400 Subject: [PATCH 13/28] fix error 71-76 --- modules/survey_accounts/test/survey_accountsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/survey_accounts/test/survey_accountsTest.php b/modules/survey_accounts/test/survey_accountsTest.php index 1f16957b491..2187c31bd62 100644 --- a/modules/survey_accounts/test/survey_accountsTest.php +++ b/modules/survey_accounts/test/survey_accountsTest.php @@ -31,7 +31,7 @@ public function setUp() array( 'CenterID' => '55', 'Name' => 'TESTinPSC', - 'Alias' => 'test', + 'Alias' => 'tst', 'MRI_alias' => 'test' ) ); From 42f0f65b1af6dcfe9a024ddff9d26c708947016e Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 16:03:35 -0400 Subject: [PATCH 14/28] trying a new date format in new_profile --- modules/new_profile/test/new_profileTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/new_profile/test/new_profileTest.php b/modules/new_profile/test/new_profileTest.php index d2bf6914251..afc5116bfaa 100644 --- a/modules/new_profile/test/new_profileTest.php +++ b/modules/new_profile/test/new_profileTest.php @@ -174,8 +174,8 @@ function testNewProfileDoBDateError() { $this->webDriver->get($this->url . "/new_profile/"); $dates = $this->webDriver->findElements(WebDriverBy::cssSelector(".input-date")); - $dates[0]->sendKeys("01/01/2015"); - $dates[1]->sendKeys("01/02/2015"); + $dates[0]->sendKeys("2015-01-01"); + $dates[1]->sendKeys("2015-02-01"); $this->webDriver->findElement(WebDriverBy::Xpath("//*[@id='footer']/div[1]")) ->click(); $gender = $this->webDriver->findElement(WebDriverBy::Name("gender")); @@ -204,8 +204,8 @@ function testNewProfileCreateCandidate() { $this->webDriver->get($this->url . "/new_profile/"); $dates = $this->webDriver->findElements(WebDriverBy::cssSelector(".input-date")); - $dates[0]->sendKeys("01/01/2015"); - $dates[1]->sendKeys("01/01/2015"); + $dates[0]->sendKeys("2015-01-01"); + $dates[1]->sendKeys("2015-01-01"); $this->safeFindElement(WebDriverBy::Xpath("//*[@id='footer']/div[1]")) ->click(); sleep(1); @@ -235,8 +235,8 @@ function testNewProfilePSCIDSequential() { $this->webDriver->get($this->url . "/new_profile/"); $dates = $this->webDriver->findElements(WebDriverBy::cssSelector(".input-date")); - $dates[0]->sendKeys("01/01/2015"); - $dates[1]->sendKeys("01/01/2015"); + $dates[0]->sendKeys("2015-01-01"); + $dates[1]->sendKeys("2015-01-01"); $this->webDriver->findElement(WebDriverBy::Xpath("//*[@id='footer']/div[1]")) ->click(); sleep(1); @@ -254,8 +254,8 @@ function testNewProfilePSCIDSequential() { $this->webDriver->get($this->url . "/new_profile/"); $dates = $this->webDriver->findElements(WebDriverBy::cssSelector(".input-date")); - $dates[0]->sendKeys("01/01/2015"); - $dates[1]->sendKeys("01/01/2015"); + $dates[0]->sendKeys("2015-01-01"); + $dates[1]->sendKeys("2015-01-01"); $this->webDriver->findElement(WebDriverBy::Xpath("//*[@id='footer']/div[1]")) ->click(); sleep(1); From 09ae1fbb12be3e118340d2b9d6a53fcf2a6dd846 Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 16:25:38 -0400 Subject: [PATCH 15/28] removing unused columns in the select statement incompatible with sql_mode=only_full_group_by --- .../data_team_helper/php/NDB_Form_data_team_helper.class.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/data_team_helper/php/NDB_Form_data_team_helper.class.inc b/modules/data_team_helper/php/NDB_Form_data_team_helper.class.inc index 477c5d141b0..e81b2004f27 100644 --- a/modules/data_team_helper/php/NDB_Form_data_team_helper.class.inc +++ b/modules/data_team_helper/php/NDB_Form_data_team_helper.class.inc @@ -417,7 +417,7 @@ class NDB_Form_data_team_helper extends NDB_Form } else{ - $query = "SELECT COUNT(*), s.ID, s.visit_label, c.PSCID,s.candid, f.SessionID, f.test_name,f.data_entry,f.commentid, t.Full_name FROM session s + $query = "SELECT COUNT(*) FROM session s JOIN flag f ON (f.sessionid = s.id) JOIN candidate c ON (c.candid = s.candid) JOIN test_names t ON (t.Test_name = f.Test_name) From 223a6bb4f649796a341a06b6a9fb6b96e62fbfe6 Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 27 Sep 2016 16:48:01 -0400 Subject: [PATCH 16/28] fix another full_group_by error --- modules/dashboard/test/DashboardTest.php | 2 ++ .../data_team_helper/php/NDB_Form_data_team_helper.class.inc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/dashboard/test/DashboardTest.php b/modules/dashboard/test/DashboardTest.php index 032d2b25195..49e27732a31 100644 --- a/modules/dashboard/test/DashboardTest.php +++ b/modules/dashboard/test/DashboardTest.php @@ -111,6 +111,7 @@ function setUp() "violations_resolved", array( 'ExtID' => '1001', + 'hash' => 'not null value', 'TypeTable' => 'mri_protocol_violated_scans', 'Resolved' => 'other', ) @@ -119,6 +120,7 @@ function setUp() "violations_resolved", array( 'ExtID' => '1002', + 'hash' => 'not null value', 'TypeTable' => 'MRICandidateErrors', 'Resolved' => 'unresolved', ) diff --git a/modules/data_team_helper/php/NDB_Form_data_team_helper.class.inc b/modules/data_team_helper/php/NDB_Form_data_team_helper.class.inc index e81b2004f27..6b3636e6d2d 100644 --- a/modules/data_team_helper/php/NDB_Form_data_team_helper.class.inc +++ b/modules/data_team_helper/php/NDB_Form_data_team_helper.class.inc @@ -459,7 +459,7 @@ class NDB_Form_data_team_helper extends NDB_Form JOIN psc ON (s.CenterID = psc.CenterID) "; } else{ - $query = "SELECT COUNT(*), s.ID, s.visit_label, c.PSCID,s.candid, f.SessionID, f.test_name,f.data_entry,f.commentid, t.Full_name FROM session s + $query = "SELECT COUNT(*) FROM session s JOIN flag f ON (f.sessionid = s.id) JOIN candidate c ON (c.candid = s.candid) JOIN test_names t ON (t.Test_name = f.Test_name) From 27d4f9f9efe6b6427a279ac420b882e384e99f9d Mon Sep 17 00:00:00 2001 From: xlecours Date: Wed, 28 Sep 2016 09:12:44 -0400 Subject: [PATCH 17/28] second passe --- modules/examiner/test/ExaminerTest.php | 2 +- modules/mri_violations/test/mri_violationsTest.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/examiner/test/ExaminerTest.php b/modules/examiner/test/ExaminerTest.php index ab67585e6c3..a1d17b1e58b 100644 --- a/modules/examiner/test/ExaminerTest.php +++ b/modules/examiner/test/ExaminerTest.php @@ -48,7 +48,7 @@ public function setUp() 'Study_site' => 'Y', 'StateID' => '0', 'Alias' => 'DDD', - 'MRI_alias' => 'TESTTEST', + 'MRI_alias' => 'TEST', ) ); } diff --git a/modules/mri_violations/test/mri_violationsTest.php b/modules/mri_violations/test/mri_violationsTest.php index 3f9308c6e12..a6d204e00e8 100644 --- a/modules/mri_violations/test/mri_violationsTest.php +++ b/modules/mri_violations/test/mri_violationsTest.php @@ -84,6 +84,7 @@ public function setUp() "violations_resolved", array( 'ExtID' => '1001', + 'hash' => 'not null value', 'TypeTable' => 'mri_protocol_violated_scans', 'Resolved' => 'other' ) @@ -92,6 +93,7 @@ public function setUp() "violations_resolved", array( 'ExtID' => '1002', + 'hash' => 'not null value', 'TypeTable' => 'MRICandidateErrors', 'Resolved' => 'unresolved' ) From 33c91e9cff3380d84fbe46a392012a7b7991fe27 Mon Sep 17 00:00:00 2001 From: xlecours Date: Wed, 28 Sep 2016 09:47:59 -0400 Subject: [PATCH 18/28] fix statistics-behavioural group by error test for UserAccountsIntegrationTest::testAddNewUser --- modules/statistics/php/NDB_Form_statistics.class.inc | 2 +- modules/user_accounts/test/user_accountsTest.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/statistics/php/NDB_Form_statistics.class.inc b/modules/statistics/php/NDB_Form_statistics.class.inc index 6a442b210e7..063e22a1254 100644 --- a/modules/statistics/php/NDB_Form_statistics.class.inc +++ b/modules/statistics/php/NDB_Form_statistics.class.inc @@ -525,7 +525,7 @@ class NDB_Form_statistics extends NDB_Form AND c.Active='Y' $suproject_query $Param_Project - GROUP BY s.CenterID, VLabel, f.Data_Entry ORDER BY c.PSCID;", + GROUP BY s.CenterID, VLabel, f.Data_Entry", $this->params ); foreach($result as $row) { diff --git a/modules/user_accounts/test/user_accountsTest.php b/modules/user_accounts/test/user_accountsTest.php index 92b90ee5edc..4a91f191742 100644 --- a/modules/user_accounts/test/user_accountsTest.php +++ b/modules/user_accounts/test/user_accountsTest.php @@ -227,6 +227,12 @@ function testAddNewUser() $field->sendKeys('email@gmail.com'); $this->safeClick(WebDriverBy::Name('SendEmail')); $this->safeClick(WebDriverBy::Name('fire_away')); + + $bodyText = $this->safeFindElement( + WebDriverBy::cssSelector("body") + )->getText(); +var_dump($bodyText); + $this->_accessUser('user_accounts', 'userid'); $field = $this->safeFindElement(WebDriverBy::Name('First_name')); $this->assertEquals($field->getAttribute('value'), 'first'); From 1f3d4027df37a8034872c33eb92308c1a9e16c79 Mon Sep 17 00:00:00 2001 From: xlecours Date: Wed, 28 Sep 2016 10:31:04 -0400 Subject: [PATCH 19/28] looking at user_accountsTest error --- modules/user_accounts/test/user_accountsTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/user_accounts/test/user_accountsTest.php b/modules/user_accounts/test/user_accountsTest.php index 4a91f191742..5755d21cfe3 100644 --- a/modules/user_accounts/test/user_accountsTest.php +++ b/modules/user_accounts/test/user_accountsTest.php @@ -231,8 +231,7 @@ function testAddNewUser() $bodyText = $this->safeFindElement( WebDriverBy::cssSelector("body") )->getText(); -var_dump($bodyText); - +$this->assertContains('p8yuidabhs97cph0a9x72bdh',$bodyText); $this->_accessUser('user_accounts', 'userid'); $field = $this->safeFindElement(WebDriverBy::Name('First_name')); $this->assertEquals($field->getAttribute('value'), 'first'); From 9aa806823219943e0435756bf45ea36beb85867c Mon Sep 17 00:00:00 2001 From: xlecours Date: Wed, 28 Sep 2016 10:48:21 -0400 Subject: [PATCH 20/28] setting password expiry default value to a valid date --- modules/user_accounts/php/NDB_Form_user_accounts.class.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/user_accounts/php/NDB_Form_user_accounts.class.inc b/modules/user_accounts/php/NDB_Form_user_accounts.class.inc index 07afb26cf15..0cfa4a8b629 100644 --- a/modules/user_accounts/php/NDB_Form_user_accounts.class.inc +++ b/modules/user_accounts/php/NDB_Form_user_accounts.class.inc @@ -191,7 +191,7 @@ class NDB_Form_User_Accounts extends NDB_Form // generate new password if (!empty($values['NA_Password'])) { $values['Password_md5'] = User::newPassword(); - $values['Password_expiry'] = '0000-00-00'; + $values['Password_expiry'] = '1990-10-22'; } unset($values['NA_Password']); From 67f110d0b6cd8934a20135858f4a5e0c9179d42d Mon Sep 17 00:00:00 2001 From: xlecours Date: Wed, 28 Sep 2016 10:49:39 -0400 Subject: [PATCH 21/28] should be fine --- modules/user_accounts/test/user_accountsTest.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/user_accounts/test/user_accountsTest.php b/modules/user_accounts/test/user_accountsTest.php index 5755d21cfe3..92b90ee5edc 100644 --- a/modules/user_accounts/test/user_accountsTest.php +++ b/modules/user_accounts/test/user_accountsTest.php @@ -227,11 +227,6 @@ function testAddNewUser() $field->sendKeys('email@gmail.com'); $this->safeClick(WebDriverBy::Name('SendEmail')); $this->safeClick(WebDriverBy::Name('fire_away')); - - $bodyText = $this->safeFindElement( - WebDriverBy::cssSelector("body") - )->getText(); -$this->assertContains('p8yuidabhs97cph0a9x72bdh',$bodyText); $this->_accessUser('user_accounts', 'userid'); $field = $this->safeFindElement(WebDriverBy::Name('First_name')); $this->assertEquals($field->getAttribute('value'), 'first'); From d19bd4e71d174860d332eeee9da1c6cca584d6fb Mon Sep 17 00:00:00 2001 From: xlecours Date: Wed, 28 Sep 2016 11:58:29 -0400 Subject: [PATCH 22/28] Strict standards: Only variables should be assigned by reference --- modules/user_accounts/php/NDB_Form_user_accounts.class.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/user_accounts/php/NDB_Form_user_accounts.class.inc b/modules/user_accounts/php/NDB_Form_user_accounts.class.inc index 0cfa4a8b629..9061dec8e06 100644 --- a/modules/user_accounts/php/NDB_Form_user_accounts.class.inc +++ b/modules/user_accounts/php/NDB_Form_user_accounts.class.inc @@ -441,7 +441,7 @@ class NDB_Form_User_Accounts extends NDB_Form // center ID if ($editor->hasPermission('user_accounts_multisite')) { // get the list of study sites - to be replaced by the Site object - $siteOptions =& Utility::getSiteList(false); + $siteOptions = Utility::getSiteList(false); } else { // allow only to add to their own site $siteOptions From 5ab2c2c15fede7d6449014c97eb657c7864a5de8 Mon Sep 17 00:00:00 2001 From: xlecours Date: Wed, 28 Sep 2016 13:33:12 -0400 Subject: [PATCH 23/28] see qhat is in the body --- modules/user_accounts/test/user_accountsTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/user_accounts/test/user_accountsTest.php b/modules/user_accounts/test/user_accountsTest.php index 92b90ee5edc..737ae8bea26 100644 --- a/modules/user_accounts/test/user_accountsTest.php +++ b/modules/user_accounts/test/user_accountsTest.php @@ -227,6 +227,11 @@ function testAddNewUser() $field->sendKeys('email@gmail.com'); $this->safeClick(WebDriverBy::Name('SendEmail')); $this->safeClick(WebDriverBy::Name('fire_away')); + $bodyText = $this->safeFindElement( + WebDriverBy::cssSelector("body") + WebDriverBy::cssSelector("body") + )->getText(); + $this->assertContains('p8yuidabhs97cph0a9x72bdh',$bodyText); $this->_accessUser('user_accounts', 'userid'); $field = $this->safeFindElement(WebDriverBy::Name('First_name')); $this->assertEquals($field->getAttribute('value'), 'first'); From 039b7d683287c942d60b7330a7bf32d64b3b85df Mon Sep 17 00:00:00 2001 From: xlecours Date: Wed, 28 Sep 2016 14:00:58 -0400 Subject: [PATCH 24/28] typo --- modules/user_accounts/test/user_accountsTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/user_accounts/test/user_accountsTest.php b/modules/user_accounts/test/user_accountsTest.php index 737ae8bea26..9f3e326480e 100644 --- a/modules/user_accounts/test/user_accountsTest.php +++ b/modules/user_accounts/test/user_accountsTest.php @@ -229,7 +229,6 @@ function testAddNewUser() $this->safeClick(WebDriverBy::Name('fire_away')); $bodyText = $this->safeFindElement( WebDriverBy::cssSelector("body") - WebDriverBy::cssSelector("body") )->getText(); $this->assertContains('p8yuidabhs97cph0a9x72bdh',$bodyText); $this->_accessUser('user_accounts', 'userid'); From 5bcf3c1f99da97acc7ff64ef1bde741d1539ba28 Mon Sep 17 00:00:00 2001 From: xlecours Date: Wed, 28 Sep 2016 14:23:19 -0400 Subject: [PATCH 25/28] Removing referenced assignement --- .../php/NDB_Form_user_accounts.class.inc | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/user_accounts/php/NDB_Form_user_accounts.class.inc b/modules/user_accounts/php/NDB_Form_user_accounts.class.inc index 9061dec8e06..432b2ad1798 100644 --- a/modules/user_accounts/php/NDB_Form_user_accounts.class.inc +++ b/modules/user_accounts/php/NDB_Form_user_accounts.class.inc @@ -43,11 +43,11 @@ class NDB_Form_User_Accounts extends NDB_Form function _hasAccess() { // create user object - $editor =& User::singleton(); + $editor = User::singleton(); if ($this->page == 'edit_user') { if (!$this->isCreatingNewUser()) { - $user =& User::factory($this->identifier); + $user = User::factory($this->identifier); } if ($editor->hasPermission('user_accounts')) { @@ -79,7 +79,7 @@ class NDB_Form_User_Accounts extends NDB_Form $defaults = array(); if (!$this->isCreatingNewUser()) { - $user =& User::factory($this->identifier); + $user = User::factory($this->identifier); // get the user defaults $defaults = $user->getData(); // remove the password hash @@ -140,21 +140,21 @@ class NDB_Form_User_Accounts extends NDB_Form $permissionsRemoved = array(); $permissionsAdded = array(); - $editor =& User::singleton(); + $editor = User::singleton(); // build the "real name" $values['Real_name'] = $values['First_name'] . ' ' . $values['Last_name']; //create the user if (!is_null($this->identifier)) { - $user =& User::factory($this->identifier); + $user = User::factory($this->identifier); } else { // Since the form has been validated there are two possibilities: // - UID is set // - UID is not set but the "Match UID to email" checkbox is checked $effectiveUID = $values['NA_UserID'] == 'on' ? $values['Email'] : $values['UserID']; - $user =& User::factory($effectiveUID); + $user = User::factory($effectiveUID); } ////Get the current permissions///// @@ -211,10 +211,10 @@ class NDB_Form_User_Accounts extends NDB_Form if ($this->isCreatingNewUser()) { // insert a new user $success = User::insert($set); - $user =& User::factory($set['UserID']); + $user = User::factory($set['UserID']); } else { // update the user - $user =& User::factory($this->identifier); + $user = User::factory($this->identifier); $success = $user->update($set); } @@ -291,7 +291,7 @@ class NDB_Form_User_Accounts extends NDB_Form // send the user an email if (!empty($send)) { // create an instance of the config object - $config =& NDB_Config::singleton(); + $config = NDB_Config::singleton(); // send the user an email $msg_data['study'] = $config->getSetting('title'); @@ -322,7 +322,7 @@ class NDB_Form_User_Accounts extends NDB_Form $this->redirect = "test_name=$this->name"; ///get the value for additional_user_info flag - $config =& NDB_Config::singleton(); + $config = NDB_Config::singleton(); $additional_user_info = $config->getSetting('additional_user_info'); //------------------------------------------------------------ @@ -436,7 +436,7 @@ class NDB_Form_User_Accounts extends NDB_Form //------------------------------------------------------------ // get user permissions - $editor =& User::singleton(); + $editor = User::singleton(); // center ID if ($editor->hasPermission('user_accounts_multisite')) { @@ -502,7 +502,7 @@ class NDB_Form_User_Accounts extends NDB_Form //getting users name and emails to create checkboxes // to email supervisors on permissions changes - $DB_factory =& NDB_Factory::singleton(); + $DB_factory = NDB_Factory::singleton(); $DB = $DB_factory->database(); $query = "SELECT u.Real_Name, u.email FROM permissions p @@ -536,7 +536,7 @@ class NDB_Form_User_Accounts extends NDB_Form unset($group); if (!$this->isCreatingNewUser()) { - $user =& User::factory($this->identifier); + $user = User::factory($this->identifier); // add hidden permissions if editor has less permissions than user // being edited @@ -568,7 +568,7 @@ class NDB_Form_User_Accounts extends NDB_Form $this->identifier = $_SESSION['State']->getUsername(); ///get the value for additional_user_info flag - $config =& NDB_Config::singleton(); + $config = NDB_Config::singleton(); $additional_user_info = $config->getSetting('additional_user_info'); //------------------------------------------------------------ @@ -650,7 +650,7 @@ class NDB_Form_User_Accounts extends NDB_Form $this->form->addElement('password', '__Confirm', 'Confirm Password'); // document repository notifications - $editor =& User::singleton(); + $editor = User::singleton(); if ($editor->hasPermission('document_repository_view') || $editor->hasPermission('document_repository_delete') ) { @@ -683,7 +683,7 @@ class NDB_Form_User_Accounts extends NDB_Form function _validateEditUser($values) { // create DB object - $DB =& Database::singleton(); + $DB = Database::singleton(); $errors = array(); //============================================ @@ -871,7 +871,7 @@ class NDB_Form_User_Accounts extends NDB_Form function _validateMyPreferences($values) { // create DB object - $DB =& Database::singleton(); + $DB = Database::singleton(); $errors = array(); // if password is user-defined, and user wants to change password @@ -954,7 +954,7 @@ class NDB_Form_User_Accounts extends NDB_Form */ function getDescriptionUsingPermID($permID) { - $db_factory =& NDB_Factory::singleton(); + $db_factory = NDB_Factory::singleton(); $db = $db_factory->database(); $permission = $db->pselectOne( From 272adc14d4b9e989c70fafe680147ffa23f5e021 Mon Sep 17 00:00:00 2001 From: xlecours Date: Wed, 28 Sep 2016 14:58:37 -0400 Subject: [PATCH 26/28] chnaging default values for zero dates --- SQL/0000-00-00-schema.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SQL/0000-00-00-schema.sql b/SQL/0000-00-00-schema.sql index f0c9e359176..fe8c7e377d7 100644 --- a/SQL/0000-00-00-schema.sql +++ b/SQL/0000-00-00-schema.sql @@ -1086,12 +1086,12 @@ CREATE TABLE `tarchive` ( `DicomArchiveID` varchar(255) NOT NULL default '', `PatientID` varchar(255) NOT NULL default '', `PatientName` varchar(255) NOT NULL default '', - `PatientDoB` date NOT NULL default '0000-00-00', + `PatientDoB` date default NULL, `PatientGender` varchar(255) default NULL, `neurodbCenterName` varchar(255) default NULL, `CenterName` varchar(255) NOT NULL default '', - `LastUpdate` datetime NOT NULL default '0000-00-00 00:00:00', - `DateAcquired` date NOT NULL default '0000-00-00', + `LastUpdate` datetime default NULL, + `DateAcquired` date default NULL, `DateFirstArchived` datetime default NULL, `DateLastArchived` datetime default NULL, `AcquisitionCount` int(11) NOT NULL default '0', @@ -1311,7 +1311,7 @@ CREATE TABLE `users` ( `Active` enum('Y','N') NOT NULL default 'Y', `Password_md5` varchar(34) default NULL, `Password_hash` varchar(255) default NULL, - `Password_expiry` date NOT NULL default '0000-00-00', + `Password_expiry` date default NULL, `Pending_approval` enum('Y','N') default 'Y', `Doc_Repo_Notifications` enum('Y','N') default 'N', PRIMARY KEY (`ID`), From 5bdbb1cd04c86ed4c6ed8ff501b8503caf76d810 Mon Sep 17 00:00:00 2001 From: xlecours Date: Wed, 28 Sep 2016 15:16:51 -0400 Subject: [PATCH 27/28] changing enter to space --- modules/user_accounts/test/user_accountsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/user_accounts/test/user_accountsTest.php b/modules/user_accounts/test/user_accountsTest.php index 9f3e326480e..ddc5c28e900 100644 --- a/modules/user_accounts/test/user_accountsTest.php +++ b/modules/user_accounts/test/user_accountsTest.php @@ -211,7 +211,7 @@ function testAddNewUser() // Click somehow does not work but this should be // equivalent $element = $this->safeFindElement(WebDriverBy::Name('NA_Password')); - $element->sendKeys(WebDriverKeys::RETURN_KEY); + $element->sendKeys(WebDriverKeys::SPACE); $field = $this->safeFindElement(WebDriverBy::Name('First_name')); $field->clear(); From 94a68b3b51d92913afbede29c0d181b497bcf046 Mon Sep 17 00:00:00 2001 From: xlecours Date: Wed, 28 Sep 2016 15:20:21 -0400 Subject: [PATCH 28/28] removing body text lookup --- modules/user_accounts/test/user_accountsTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/user_accounts/test/user_accountsTest.php b/modules/user_accounts/test/user_accountsTest.php index ddc5c28e900..850913ca699 100644 --- a/modules/user_accounts/test/user_accountsTest.php +++ b/modules/user_accounts/test/user_accountsTest.php @@ -227,10 +227,12 @@ function testAddNewUser() $field->sendKeys('email@gmail.com'); $this->safeClick(WebDriverBy::Name('SendEmail')); $this->safeClick(WebDriverBy::Name('fire_away')); +/* $bodyText = $this->safeFindElement( WebDriverBy::cssSelector("body") )->getText(); $this->assertContains('p8yuidabhs97cph0a9x72bdh',$bodyText); +*/ $this->_accessUser('user_accounts', 'userid'); $field = $this->safeFindElement(WebDriverBy::Name('First_name')); $this->assertEquals($field->getAttribute('value'), 'first');