From fe3b70460acc7062525f80cee7e3ebc4ad9faf71 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 19 Apr 2013 19:11:41 -0500 Subject: [PATCH 01/13] Minor - Added internationalization_database directory ignore directive in build.xml --- tests/build.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/build.xml b/tests/build.xml index 70e80f4bfc..de412015e9 100644 --- a/tests/build.xml +++ b/tests/build.xml @@ -99,7 +99,7 @@ - + From 953971fd7c9fd0214281c3cbc7ee842ceb144549 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 19 Apr 2013 20:13:30 -0500 Subject: [PATCH 02/13] Minor - Change of syntax to avoid fatal error in phpunit tests --- main/inc/lib/add_courses_to_session_functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/inc/lib/add_courses_to_session_functions.lib.php b/main/inc/lib/add_courses_to_session_functions.lib.php index 3e10ab2f2b..ced70e9084 100644 --- a/main/inc/lib/add_courses_to_session_functions.lib.php +++ b/main/inc/lib/add_courses_to_session_functions.lib.php @@ -7,7 +7,7 @@ /** * Init */ -require_once (api_get_path(LIBRARY_PATH).'xajax/xajax.inc.php'); +require_once dirname(__FILE__).'/xajax/xajax.inc.php'; //require_once (api_get_path(SYS_CODE_PATH).'admin/add_courses_to_session.php'); /** From 2d843864d43db808591b758fb79813b232520926 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 19 Apr 2013 20:28:15 -0500 Subject: [PATCH 03/13] Minor - Added inclusion of database lib in unit test to avoid fatal error --- tests/phpunit/classes/AddCourseToSessionTest.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/phpunit/classes/AddCourseToSessionTest.lib.php b/tests/phpunit/classes/AddCourseToSessionTest.lib.php index 3e1fcf46a0..c3c664a476 100644 --- a/tests/phpunit/classes/AddCourseToSessionTest.lib.php +++ b/tests/phpunit/classes/AddCourseToSessionTest.lib.php @@ -16,6 +16,7 @@ class AddCourseToSessionTest extends PHPUnit_Framework_TestCase protected function setUp() { require_once dirname(__FILE__).'/../../../main/inc/global.inc.php'; + require_once dirname(__FILE__).'/../../../main/inc/lib/database.lib.php'; $this->object = new AddCourseToSession; } From a7282cddcb4179f15935738392b7f37810f2c4da Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 19 Apr 2013 23:09:10 -0500 Subject: [PATCH 04/13] Removed test on Accessurleditsessions as it slows down considerably the testing process --- .../AccessurleditsessionstourlTest.lib.php | 47 ------------------- 1 file changed, 47 deletions(-) delete mode 100644 tests/phpunit/classes/AccessurleditsessionstourlTest.lib.php diff --git a/tests/phpunit/classes/AccessurleditsessionstourlTest.lib.php b/tests/phpunit/classes/AccessurleditsessionstourlTest.lib.php deleted file mode 100644 index fe3649e7e3..0000000000 --- a/tests/phpunit/classes/AccessurleditsessionstourlTest.lib.php +++ /dev/null @@ -1,47 +0,0 @@ -object = new Accessurleditsessionstourl; - } - - /** - * Tears down the fixture, for example, closes a network connection. - * This method is called after a test is executed. - */ - protected function tearDown() - { - ob_end_clean(); - } - - /** - * Generated from @assert () === false. - * - * @covers Accessurleditsessionstourl::search_sessions - */ - public function testSearch_sessions() - { - ob_start(); - $this->assertSame( - false, - $this->object->search_sessions(null,null) - ); - ob_end_clean(); - } -} From f38980b8aa090e1cfd1fc5387512919f575a3ab7 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 19 Apr 2013 23:18:00 -0500 Subject: [PATCH 05/13] Minor fix for phpunit --- main/inc/lib/add_many_session_to_category_functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/inc/lib/add_many_session_to_category_functions.lib.php b/main/inc/lib/add_many_session_to_category_functions.lib.php index 05efe80b70..9f5e7593bb 100644 --- a/main/inc/lib/add_many_session_to_category_functions.lib.php +++ b/main/inc/lib/add_many_session_to_category_functions.lib.php @@ -7,7 +7,7 @@ /** * Init */ -require_once (api_get_path(LIBRARY_PATH).'xajax/xajax.inc.php'); +require_once dirname(__FILE__).'/xajax/xajax.inc.php'; /** * AddManySessionToCategoryFunctions class */ From cf4ff8a4b9631b9c0ac4ea51fe51719bd45a93bd Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 20 Apr 2013 00:23:45 -0400 Subject: [PATCH 06/13] fixing error uploading file #6034 --- main/dropbox/dropbox_class.inc.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main/dropbox/dropbox_class.inc.php b/main/dropbox/dropbox_class.inc.php index 45689df10b..69e8992b4e 100644 --- a/main/dropbox/dropbox_class.inc.php +++ b/main/dropbox/dropbox_class.inc.php @@ -252,7 +252,7 @@ class Dropbox_SentWork extends Dropbox_Work * @param unknown_type $recipient_ids */ function _createNewSentWork($uploader_id, $title, $description, $author, $filename, $filesize, $recipient_ids) { - global $dropbox_cnf; + global $dropbox_cnf; // Call constructor of Dropbox_Work object $this->Dropbox_Work($uploader_id, $title, $description, $author, $filename, $filesize); @@ -284,6 +284,7 @@ class Dropbox_SentWork extends Dropbox_Work $table_person = $dropbox_cnf['tbl_person']; $session_id = api_get_session_id(); $uploader_id = $this->uploader_id; + $user = api_get_user_id(); // Insert data in dropbox_post and dropbox_person table for each recipient foreach ($this->recipients as $rec) { $file_id = (int)$this->id; @@ -296,7 +297,7 @@ class Dropbox_SentWork extends Dropbox_Work /** * Poster is already added when work is created - not so good to split logic */ - //if ($user_id != $user_id) { + if ($user_id != $user) { // Insert entries into person table $sql = "INSERT INTO $table_person (c_id, file_id, user_id) VALUES ($course_id, $file_id, $user_id)"; @@ -305,7 +306,7 @@ class Dropbox_SentWork extends Dropbox_Work if (!$justSubmit) { $result = Database::query($sql); // If work already exists no error is generated } - //} + } // Update item_property table for each recipient global $_course, $dropbox_cnf; From 91804255e2bb0694f4c25374665c968dacbcd3da Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 20 Apr 2013 01:29:00 -0400 Subject: [PATCH 07/13] fixing survey orientation 5956 --- main/survey/survey.lib.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/main/survey/survey.lib.php b/main/survey/survey.lib.php index f9692ad207..315957236d 100644 --- a/main/survey/survey.lib.php +++ b/main/survey/survey.lib.php @@ -1647,7 +1647,11 @@ class ch_yesno extends survey_question { if (is_array($form_content['options'])) { // Check if data is correct foreach ($form_content['options'] as $key => & $value) { - $this->html .= '