Skip to content

Commit

Permalink
Test fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
aarpon committed Jan 24, 2017
1 parent 0007ca5 commit cdfcb08
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
7 changes: 6 additions & 1 deletion tests/php/ActiveDirUserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use hrm\user\UserManager;
use hrm\user\UserV2;

require_once dirname(__FILE__) . '/../inc/bootstrap.php';
require_once dirname(__FILE__) . '/../../inc/bootstrap.php';

/*
Configuration file for the test. Copy:
Expand Down Expand Up @@ -214,6 +214,11 @@ public function testChangingUserStatus()
# Make sure the User is disabled
$user = UserManager::reload($user);
$this->assertTrue($user->status() == UserConstants::STATUS_DISABLED);

# Now re-enable the User
$this->assertTrue(
UserManager::enableUser($user->name())
);
}

}
2 changes: 1 addition & 1 deletion tests/php/IntegratedUserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use hrm\user\UserManager;
use hrm\user\UserV2;

require_once dirname(__FILE__) . '/../inc/bootstrap.php';
require_once dirname(__FILE__) . '/../../inc/bootstrap.php';

class IntegratedUserTest extends PHPUnit_Framework_TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/php/SetupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright and license notice: see license.txt

// Bootstrap
require_once dirname(__FILE__) . '/../inc/bootstrap.php';
require_once dirname(__FILE__) . '/../../inc/bootstrap.php';

/**
* This test makes sure that the structure of the project is correct.
Expand Down
46 changes: 46 additions & 0 deletions tests/php/TestLogger.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* Created by PhpStorm.
* User: pontia
* Date: 1/24/17
* Time: 10:45 AM
*/

use hrm\Log;

require_once dirname(__FILE__) . '/../../inc/bootstrap.php';

class TestLogger extends PHPUnit_Framework_TestCase
{

/**
* Test info logging
*/
public function testInfoLogging()
{
global $log_verbosity;
$log_verbosity = 2;
Log::info("This is an INFO log.");
}

/**
* Test warning logging
*/
public function testWarningLogging()
{
global $log_verbosity;
$log_verbosity = 2;
Log::warning("This is a WARNING log.");
}

/**
* Test error logging
*/
public function testErrorLogging()
{
global $log_verbosity;
$log_verbosity = 2;
Log::error("This is an ERROR log.");
}

}

0 comments on commit cdfcb08

Please sign in to comment.