Skip to content

Commit 512c617

Browse files
authored
Merge pull request facebookarchive#820 from yguedidi/prefer_lowest
Add prefer lowest dependencies builds
2 parents 5585d4f + 5e05209 commit 512c617

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+358
-465
lines changed

.travis.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
language: php
22

3+
dist: trusty
4+
35
sudo: false
46

57
cache:
@@ -9,17 +11,19 @@ cache:
911
matrix:
1012
include:
1113
- php: 7.1
14+
- php: 7.1
15+
env:
16+
- deps=low
17+
- php: nightly
1218
- php: nightly
19+
env:
20+
- deps=low
1321
- php: hhvm
14-
dist: trusty
1522
- php: hhvm-nightly
16-
dist: trusty
1723
# Allow failures until Travis build includes HHVM 3.20.2 which fix the issue with composer (see http://hhvm.com/blog/2017/06/07/hhvm-3-20.html)
1824
allow_failures:
1925
- php: hhvm
20-
dist: trusty
2126
- php: hhvm-nightly
22-
dist: trusty
2327
fast_finish: true
2428

2529
before_install:
@@ -28,7 +32,8 @@ before_install:
2832

2933
install:
3034
- travis_retry composer require --dev --no-update squizlabs/php_codesniffer
31-
- travis_retry composer install --prefer-dist --no-interaction
35+
- if [ $deps != low ]; then travis_retry composer update --no-interaction --prefer-dist; fi;
36+
- if [ $deps == low ]; then travis_retry composer update --no-interaction --prefer-dist --prefer-lowest; fi;
3237

3338
script:
3439
- vendor/bin/phpcs

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
"php": "^7.1"
1919
},
2020
"require-dev": {
21-
"guzzlehttp/guzzle": "~5.0",
22-
"mockery/mockery": "~0.8",
23-
"phpunit/phpunit": "^5.7.5"
21+
"guzzlehttp/guzzle": "^5.3.1",
22+
"phpunit/phpunit": "^6.2"
2423
},
2524
"suggest": {
2625
"guzzlehttp/guzzle": "Allows for implementation of the Guzzle HTTP client"

phpunit.xml.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,4 @@
1616
<directory suffix=".php">./src/Facebook</directory>
1717
</whitelist>
1818
</filter>
19-
<listeners>
20-
<listener class="\Mockery\Adapter\Phpunit\TestListener"/>
21-
</listeners>
2219
</phpunit>

src/HttpClients/FacebookCurlHttpClient.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ public function send($url, $method, $body, array $headers, $timeOut)
7070
$this->sendRequest();
7171

7272
if ($curlErrorCode = $this->facebookCurl->errno()) {
73+
$this->closeConnection();
74+
7375
throw new FacebookSDKException($this->facebookCurl->error(), $curlErrorCode);
7476
}
7577

tests/Authentication/AccessTokenMetadataTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
namespace Facebook\Tests\Authentication;
2525

2626
use Facebook\Authentication\AccessTokenMetadata;
27+
use PHPUnit\Framework\TestCase;
2728

28-
class AccessTokenMetadataTest extends \PHPUnit_Framework_TestCase
29+
class AccessTokenMetadataTest extends TestCase
2930
{
3031

3132
protected $graphResponseData = [
@@ -93,6 +94,8 @@ public function testAnExpectedAppIdWillNotThrow()
9394
{
9495
$metadata = new AccessTokenMetadata($this->graphResponseData);
9596
$metadata->validateAppId('123');
97+
98+
$this->assertTrue(true);
9699
}
97100

98101
/**
@@ -102,12 +105,16 @@ public function testAnUnexpectedAppIdWillThrow()
102105
{
103106
$metadata = new AccessTokenMetadata($this->graphResponseData);
104107
$metadata->validateAppId('foo');
108+
109+
$this->assertTrue(true);
105110
}
106111

107112
public function testAnExpectedUserIdWillNotThrow()
108113
{
109114
$metadata = new AccessTokenMetadata($this->graphResponseData);
110115
$metadata->validateUserId('1337');
116+
117+
$this->assertTrue(true);
111118
}
112119

113120
/**
@@ -124,6 +131,8 @@ public function testAnActiveAccessTokenWillNotThrow()
124131
$this->graphResponseData['data']['expires_at'] = time() + 1000;
125132
$metadata = new AccessTokenMetadata($this->graphResponseData);
126133
$metadata->validateExpiration();
134+
135+
$this->assertTrue(true);
127136
}
128137

129138
/**

tests/Authentication/AccessTokenTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
namespace Facebook\Tests\Authentication;
2525

2626
use Facebook\Authentication\AccessToken;
27+
use PHPUnit\Framework\TestCase;
2728

28-
class AccessTokenTest extends \PHPUnit_Framework_TestCase
29+
class AccessTokenTest extends TestCase
2930
{
3031

3132
public function testAnAccessTokenCanBeReturnedAsAString()

tests/Authentication/OAuth2ClientTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
use Facebook\Authentication\OAuth2Client;
2929
use Facebook\Authentication\AccessTokenMetadata;
3030
use Facebook\Authentication\AccessToken;
31+
use PHPUnit\Framework\TestCase;
3132

32-
class OAuth2ClientTest extends \PHPUnit_Framework_TestCase
33+
class OAuth2ClientTest extends TestCase
3334
{
3435

3536
/**

tests/Exceptions/FacebookResponseExceptionTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333
use Facebook\Exceptions\FacebookAuthorizationException;
3434
use Facebook\Exceptions\FacebookClientException;
3535
use Facebook\Exceptions\FacebookOtherException;
36+
use PHPUnit\Framework\TestCase;
3637

37-
class FacebookResponseExceptionTest extends \PHPUnit_Framework_TestCase
38+
class FacebookResponseExceptionTest extends TestCase
3839
{
3940

4041
/**

tests/FacebookAppTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525

2626
use Facebook\FacebookApp;
2727
use Facebook\Authentication\AccessToken;
28+
use PHPUnit\Framework\TestCase;
2829

29-
class FacebookAppTest extends \PHPUnit_Framework_TestCase
30+
class FacebookAppTest extends TestCase
3031
{
3132
/**
3233
* @var FacebookApp

tests/FacebookBatchRequestTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
use Facebook\FacebookRequest;
2828
use Facebook\FacebookBatchRequest;
2929
use Facebook\FileUpload\FacebookFile;
30+
use PHPUnit\Framework\TestCase;
3031

31-
class FacebookBatchRequestTest extends \PHPUnit_Framework_TestCase
32+
class FacebookBatchRequestTest extends TestCase
3233
{
3334
/**
3435
* @var FacebookApp
@@ -196,6 +197,8 @@ public function testLessOrEqualThanFiftyRequestsWillNotThrow()
196197
$this->createAndAppendRequestsTo($batchRequest, 50);
197198

198199
$batchRequest->validateBatchRequestCount();
200+
201+
$this->assertTrue(true);
199202
}
200203

201204
/**

0 commit comments

Comments
 (0)