Skip to content

Commit 0f70ae5

Browse files
authored
Merge pull request #445 from heiglandreas/updateToPHPUnit6+
Adapt tests to work with PHPUnit > 5
2 parents 078d380 + 0969710 commit 0f70ae5

18 files changed

+55
-22
lines changed

tests/controllers/EventHostsControllerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
namespace JoindinTest\Controller;
44

55
use Mockery as M;
6+
use PHPUnit\Framework\TestCase;
67

7-
class EventHostsControllerTest extends \PHPUnit_Framework_TestCase
8+
class EventHostsControllerTest extends TestCase
89
{
910
/**
1011
* @expectedException \Exception

tests/controllers/TalkBase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
use TalkMapper;
1212
use TalkModel;
1313
use UserMapper;
14+
use PHPUnit\Framework\TestCase;
1415

15-
class TalkBase extends PHPUnit_Framework_TestCase
16+
class TalkBase extends TestCase
1617
{
1718
protected function createTalkMapper(mockPDO $db, Request $request, $expetcedCalls = 1)
1819
{

tests/controllers/TokenControllerTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace JoindinTest\Controller;
44

5-
class TokenControllerTest extends \PHPUnit_Framework_TestCase
5+
use PHPUnit\Framework\TestCase;
6+
7+
class TokenControllerTest extends TestCase
68
{
79
private $request;
810

tests/controllers/UsersControllerTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace JoindinTest\Controller;
44

5-
class UsersControllerTest extends \PHPUnit_Framework_TestCase
5+
use PHPUnit\Framework\TestCase;
6+
7+
class UsersControllerTest extends TestCase
68
{
79

810
/**

tests/inc/HeaderTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010

1111
namespace JoindinTest\Inc;
1212

13+
use PHPUnit\Framework\TestCase;
14+
1315
require_once __DIR__ . '/../../src/inc/Header.php';
1416

15-
class HeaderTest extends \PHPUnit_Framework_TestCase
17+
class HeaderTest extends TestCase
1618
{
1719

1820
public function testParseParamsWithEmbededSeparator()

tests/inc/RequestTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?php
22
namespace JoindinTest\Inc;
33

4+
use PHPUnit\Framework\TestCase;
5+
46
require_once __DIR__ . '/../../src/inc/Request.php';
57

6-
class RequestTest extends \PHPUnit_Framework_TestCase
8+
class RequestTest extends TestCase
79
{
810
/**
911
* Make sure we have everything we need - in this case the config

tests/inc/TalkCommentEmailServiceTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
namespace JoindinTest\Inc;
44

55
use TalkModel;
6+
use TalkCommentEmailService;
7+
use PHPUnit\Framework\TestCase;
68

79
require_once __DIR__.'/../../src/services/TalkCommentEmailService.php';
810

9-
class TalkCommentEmailServiceTest extends \PHPUnit_Framework_Testcase
11+
class TalkCommentEmailServiceTest extends Testcase
1012
{
1113

1214
protected $config = [
@@ -33,7 +35,7 @@ public function createService()
3335
$talk = new TalkModel(["talk_title" => "sample talk"]);
3436
$comment = ["comments" => [["comment" => "test comment", "rating" => 3]]];
3537

36-
$service = new \TalkCommentEmailService($this->config, $recipients, $talk, $comment);
38+
$service = new TalkCommentEmailService($this->config, $recipients, $talk, $comment);
3739
$this->assertInstanceOf('TalkCommentEmailService', $service);
3840
}
3941

@@ -50,7 +52,7 @@ public function createServiceWithEmailRedirect()
5052
$talk = new TalkModel(["talk_title" => "sample talk"]);
5153
$comment = ["comments" => [["comment" => "test comment", "rating" => 3]]];
5254

53-
$service = new \TalkCommentEmailService($config, $recipients, $talk, $comment);
55+
$service = new TalkCommentEmailService($config, $recipients, $talk, $comment);
5456
$this->assertEquals(["[email protected]"], $service->getRecipients());
5557
}
5658

@@ -65,7 +67,7 @@ public function templateReplacements()
6567
$talk = new TalkModel(["talk_title" => "sample talk"]);
6668
$comment = ["comments" => [["comment" => "test comment", "rating" => 3]]];
6769

68-
$service = new \TalkCommentEmailService($this->config, $recipients, $talk, $comment);
70+
$service = new TalkCommentEmailService($this->config, $recipients, $talk, $comment);
6971
$service->templatePath = __DIR__.'/../../src/views/emails/';
7072

7173
$template = "testTemplate.md";
@@ -94,7 +96,7 @@ public function markdownTransform()
9496
$talk = new TalkModel(["talk_title" => "sample talk"]);
9597
$comment = ["comments" => [["comment" => "test comment", "rating" => 3]]];
9698

97-
$service = new \TalkCommentEmailService($this->config, $recipients, $talk, $comment);
99+
$service = new TalkCommentEmailService($this->config, $recipients, $talk, $comment);
98100

99101
$html = $service->markdownToHtml($markdown);
100102
$this->assertEquals(

tests/models/ApiMapperTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22

3+
use PHPUnit\Framework\TestCase;
4+
35
require_once __DIR__ . '/TestApiMapper.php';
46
/**
57
*
68
*/
7-
class ApiMapperTest extends PHPUnit_Framework_TestCase
9+
class ApiMapperTest extends TestCase
810
{
911
public function setup()
1012
{

tests/models/EventHostMapperTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
class EventHostMapperTest extends PHPUnit_Framework_TestCase
3+
use PHPUnit\Framework\TestCase;
4+
5+
class EventHostMapperTest extends TestCase
46
{
57
public function testThatAddingHostToEventCallsExpectedInsert()
68
{

tests/models/OauthModelTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
class OauthModelTest extends PHPUnit_Framework_TestCase
3+
use PHPUnit\Framework\TestCase;
4+
5+
class OauthModelTest extends TestCase
46
{
57
public function setup()
68
{

0 commit comments

Comments
 (0)