This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from carusogabriel/phpunit
Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase
- Loading branch information
Showing
8 changed files
with
49 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<?php | ||
|
||
require_once 'vendor/autoload.php'; | ||
require_once 'vendor/autoload.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,45 @@ | ||
<?php | ||
namespace ApplicationInsights\Tests; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Contains tests for Current_User class | ||
*/ | ||
class Current_User_Test extends \PHPUnit_Framework_TestCase | ||
class Current_User_Test extends TestCase | ||
{ | ||
private $userId; | ||
|
||
protected function setUp() | ||
{ | ||
$this->userId = \ApplicationInsights\Channel\Contracts\Utils::returnGuid(); | ||
Utils::setUserCookie($this->userId); | ||
} | ||
|
||
protected function tearDown() | ||
{ | ||
Utils::clearUserCookie(); | ||
} | ||
|
||
/** | ||
* Verifies the object is constructed properly. | ||
*/ | ||
public function testConstructor() | ||
{ | ||
$currentUser = new \ApplicationInsights\Current_User(); | ||
|
||
$this->assertEquals($currentUser->id, $this->userId); | ||
} | ||
|
||
/** | ||
* Verifies the object is constructed properly. | ||
*/ | ||
public function testConstructorWithNoCookie() | ||
{ | ||
Utils::clearUserCookie(); | ||
$currentUser = new \ApplicationInsights\Current_User(); | ||
|
||
$this->assertTrue($currentUser->id != NULL && $currentUser->id != $this->userId); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters