Minor - Fixed issues with new unit tests

skala
Yannick Warnier 12 years ago
parent 3b31c63135
commit 04e83b6dd7
  1. 3
      tests/phpunit/classes/AccessTest.class.php
  2. 1
      tests/phpunit/classes/AccessTokenTest.class.php
  3. 10
      tests/phpunit/classes/AccessurleditcoursestourlTest.lib.php
  4. 8
      tests/phpunit/classes/AccessurleditsessionstourlTest.lib.php
  5. 10
      tests/phpunit/classes/AccessurledituserstourlTest.lib.php
  6. 1
      tests/phpunit/classes/AddCourseToSessionTest.lib.php
  7. 1
      tests/phpunit/classes/AddManySessionToCategoryFunctionsTest.lib.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;
}

@ -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;
}

@ -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))
)
);
}
}

@ -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();
}
}

@ -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))
)
);
}
}

@ -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;
}

@ -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;
}

Loading…
Cancel
Save