diff --git a/tests/phpunit/classes/AccessTest.class.php b/tests/phpunit/classes/AccessTest.class.php index 2090d3952b..fd181f9108 100644 --- a/tests/phpunit/classes/AccessTest.class.php +++ b/tests/phpunit/classes/AccessTest.class.php @@ -4,7 +4,7 @@ */ // exiting because generates fatal error: // Fatal error: Cannot instantiate abstract class Access in /var/lib/jenkins/jobs/chamilo-lms-1.9/workspace/tests/phpunit/classes/AccessTest.class.php on line 18 -exit; +//exit; class AccessTest extends PHPUnit_Framework_TestCase { /** @@ -18,6 +18,7 @@ class AccessTest extends PHPUnit_Framework_TestCase */ protected function setUp() { + require_once dirname(__FILE__).'/../../../main/inc/global.inc.php'; $this->object = new Access; } diff --git a/tests/phpunit/classes/AccessTokenTest.class.php b/tests/phpunit/classes/AccessTokenTest.class.php index eedac06d9c..88ba66142f 100644 --- a/tests/phpunit/classes/AccessTokenTest.class.php +++ b/tests/phpunit/classes/AccessTokenTest.class.php @@ -15,6 +15,7 @@ class AccessTokenTest extends PHPUnit_Framework_TestCase */ protected function setUp() { + require_once dirname(__FILE__).'/../../../main/inc/global.inc.php'; $this->object = new AccessToken; } diff --git a/tests/phpunit/classes/AccessurleditcoursestourlTest.lib.php b/tests/phpunit/classes/AccessurleditcoursestourlTest.lib.php index 77132b0ee0..857cc4ae59 100644 --- a/tests/phpunit/classes/AccessurleditcoursestourlTest.lib.php +++ b/tests/phpunit/classes/AccessurleditcoursestourlTest.lib.php @@ -15,6 +15,9 @@ class AccessurleditcoursestourlTest extends PHPUnit_Framework_TestCase */ protected function setUp() { + ob_start(); + require_once dirname(__FILE__).'/../../../main/inc/lib/access_url_edit_courses_to_url_functions.lib.php'; + require_once dirname(__FILE__).'/../../../main/inc/lib/main_api.lib.php'; $this->object = new Accessurleditcoursestourl; } @@ -24,6 +27,7 @@ class AccessurleditcoursestourlTest extends PHPUnit_Framework_TestCase */ protected function tearDown() { + ob_end_clean(); } /** @@ -33,9 +37,11 @@ class AccessurleditcoursestourlTest extends PHPUnit_Framework_TestCase */ public function testSearch_courses() { - $this->assertSame( + $this->assertThat( false, - $this->object->search_courses() + $this->logicalNot( + $this->equalTo($this->object->search_courses(null, null)) + ) ); } } diff --git a/tests/phpunit/classes/AccessurleditsessionstourlTest.lib.php b/tests/phpunit/classes/AccessurleditsessionstourlTest.lib.php index 9e27393b32..fe3649e7e3 100644 --- a/tests/phpunit/classes/AccessurleditsessionstourlTest.lib.php +++ b/tests/phpunit/classes/AccessurleditsessionstourlTest.lib.php @@ -15,6 +15,9 @@ class AccessurleditsessionstourlTest extends PHPUnit_Framework_TestCase */ protected function setUp() { + ob_start(); + require_once dirname(__FILE__).'/../../../main/inc/lib/access_url_edit_sessions_to_url_functions.lib.php'; + require_once dirname(__FILE__).'/../../../main/inc/lib/main_api.lib.php'; $this->object = new Accessurleditsessionstourl; } @@ -24,6 +27,7 @@ class AccessurleditsessionstourlTest extends PHPUnit_Framework_TestCase */ protected function tearDown() { + ob_end_clean(); } /** @@ -33,9 +37,11 @@ class AccessurleditsessionstourlTest extends PHPUnit_Framework_TestCase */ public function testSearch_sessions() { + ob_start(); $this->assertSame( false, - $this->object->search_sessions() + $this->object->search_sessions(null,null) ); + ob_end_clean(); } } diff --git a/tests/phpunit/classes/AccessurledituserstourlTest.lib.php b/tests/phpunit/classes/AccessurledituserstourlTest.lib.php index f6d7c59914..ba5372dd68 100644 --- a/tests/phpunit/classes/AccessurledituserstourlTest.lib.php +++ b/tests/phpunit/classes/AccessurledituserstourlTest.lib.php @@ -15,6 +15,9 @@ class AccessurledituserstourlTest extends PHPUnit_Framework_TestCase */ protected function setUp() { + ob_start(); + require_once dirname(__FILE__).'/../../../main/inc/lib/access_url_edit_users_to_url_functions.lib.php'; + require_once dirname(__FILE__).'/../../../main/inc/lib/main_api.lib.php'; $this->object = new Accessurledituserstourl; } @@ -24,6 +27,7 @@ class AccessurledituserstourlTest extends PHPUnit_Framework_TestCase */ protected function tearDown() { + ob_end_clean(); } /** @@ -33,9 +37,11 @@ class AccessurledituserstourlTest extends PHPUnit_Framework_TestCase */ public function testSearch_users() { - $this->assertSame( + $this->assertThat( false, - $this->object->search_users() + $this->logicalNot( + $this->equalTo($this->object->search_users(null, null)) + ) ); } } diff --git a/tests/phpunit/classes/AddCourseToSessionTest.lib.php b/tests/phpunit/classes/AddCourseToSessionTest.lib.php index b4feedab28..3e1fcf46a0 100644 --- a/tests/phpunit/classes/AddCourseToSessionTest.lib.php +++ b/tests/phpunit/classes/AddCourseToSessionTest.lib.php @@ -15,6 +15,7 @@ class AddCourseToSessionTest extends PHPUnit_Framework_TestCase */ protected function setUp() { + require_once dirname(__FILE__).'/../../../main/inc/global.inc.php'; $this->object = new AddCourseToSession; } diff --git a/tests/phpunit/classes/AddManySessionToCategoryFunctionsTest.lib.php b/tests/phpunit/classes/AddManySessionToCategoryFunctionsTest.lib.php index 6be6eca1a8..b925b73ae6 100644 --- a/tests/phpunit/classes/AddManySessionToCategoryFunctionsTest.lib.php +++ b/tests/phpunit/classes/AddManySessionToCategoryFunctionsTest.lib.php @@ -15,6 +15,7 @@ class AddManySessionToCategoryFunctionsTest extends PHPUnit_Framework_TestCase */ protected function setUp() { + require_once dirname(__FILE__).'/../../../main/inc/global.inc.php'; $this->object = new AddManySessionToCategoryFunctions; }