Skip to content

Commit 6c4905f

Browse files
authored
Add linting to CI (#266)
* Add Intercom\Test namespace to all the tests * Enforce PSR2 by CI * Fix PHPUnit imports * Import PHPUnit_Framework_TestCase
1 parent 84e936f commit 6c4905f

16 files changed

+50
-30
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ jobs:
1010
- checkout
1111
- run: composer install --no-interaction
1212
- run: vendor/bin/phpunit
13+
- run: vendor/bin/phpcs --standard=PSR2 src test

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"Intercom\\": ["src"]
1515
}
1616
},
17+
"autoload-dev": {
18+
"psr-4": {
19+
"Intercom\\Test\\": ["test"]
20+
}
21+
},
1722
"require": {
1823
"php": ">= 5.6",
1924
"ext-json": "*",

test/IntercomAdminsTest.php

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

3+
namespace Intercom\Test;
4+
35
use Intercom\IntercomAdmins;
6+
use PHPUnit_Framework_TestCase;
47

58
class IntercomAdminsTest extends PHPUnit_Framework_TestCase
69
{

test/IntercomBulkTest.php

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

3+
namespace Intercom\Test;
4+
35
use Intercom\IntercomBulk;
6+
use PHPUnit_Framework_TestCase;
47

58
class IntercomBulkTest extends PHPUnit_Framework_TestCase
69
{

test/IntercomClientTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
<?php
22

3+
namespace Intercom\Test;
4+
5+
use DateTimeImmutable;
36
use Intercom\IntercomClient;
47
use GuzzleHttp\Client;
58
use GuzzleHttp\Handler\MockHandler;
69
use GuzzleHttp\Psr7\Response;
710
use GuzzleHttp\HandlerStack;
811
use GuzzleHttp\Middleware;
12+
use PHPUnit_Framework_TestCase;
13+
use stdClass;
914

1015
class IntercomClientTest extends PHPUnit_Framework_TestCase
1116
{

test/IntercomCompaniesTest.php

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

3+
namespace Intercom\Test;
4+
35
use Intercom\IntercomCompanies;
4-
use Intercom\IntercomClient;
5-
use GuzzleHttp\Client;
6-
use GuzzleHttp\Handler\MockHandler;
7-
use GuzzleHttp\Psr7\Response;
8-
use GuzzleHttp\HandlerStack;
9-
use GuzzleHttp\Middleware;
6+
use PHPUnit_Framework_TestCase;
107

118
class IntercomCompaniesTest extends PHPUnit_Framework_TestCase
129
{

test/IntercomConversationsTest.php

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

3+
namespace Intercom\Test;
4+
35
use Intercom\IntercomConversations;
4-
use Intercom\IntercomClient;
5-
use GuzzleHttp\Client;
6-
use GuzzleHttp\Handler\MockHandler;
7-
use GuzzleHttp\Psr7\Response;
8-
use GuzzleHttp\HandlerStack;
9-
use GuzzleHttp\Middleware;
6+
use PHPUnit_Framework_TestCase;
107

118
class IntercomConversationsTest extends PHPUnit_Framework_TestCase
129
{

test/IntercomCountsTest.php

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

3+
namespace Intercom\Test;
4+
35
use Intercom\IntercomCounts;
6+
use PHPUnit_Framework_TestCase;
47

58
class IntercomCountsTest extends PHPUnit_Framework_TestCase
69
{

test/IntercomEventsTest.php

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

3+
namespace Intercom\Test;
4+
35
use Intercom\IntercomEvents;
4-
use Intercom\IntercomClient;
5-
use GuzzleHttp\Client;
6-
use GuzzleHttp\Handler\MockHandler;
7-
use GuzzleHttp\Psr7\Response;
8-
use GuzzleHttp\HandlerStack;
9-
use GuzzleHttp\Middleware;
6+
use PHPUnit_Framework_TestCase;
107

118
class IntercomEventsTest extends PHPUnit_Framework_TestCase
129
{

test/IntercomLeadsTest.php

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

3+
namespace Intercom\Test;
4+
35
use Intercom\IntercomLeads;
6+
use PHPUnit_Framework_TestCase;
47

58
class IntercomLeadsTest extends PHPUnit_Framework_TestCase
69
{

0 commit comments

Comments
 (0)