Skip to content

Commit 1caa078

Browse files
authored
Merge pull request #190 from opentok/dev
Release v3.0.0
2 parents ebf9129 + 14a871b commit 1caa078

File tree

6 files changed

+42
-41
lines changed

6 files changed

+42
-41
lines changed

.travis.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
dist: trusty
22
sudo: required
33
language: php
4-
matrix:
5-
include:
6-
- php: 5.3
7-
dist: precise
8-
- php: 5.4
9-
- php: 5.5
10-
- php: 5.6
11-
- php: hhvm
4+
php:
5+
- 5.6
6+
- 7.0
7+
- 7.1
8+
- hhvm
129
before_script:
1310
- travis_retry composer install
1411
script:

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Add this package (`opentok/opentok`) to your `composer.json` file, or just run t
1616
command line:
1717

1818
```
19-
$ ./composer.phar require opentok/opentok 2.5.x
19+
$ ./composer.phar require opentok/opentok 3.0.x
2020
```
2121

2222
## Manually:
@@ -211,7 +211,9 @@ Reference documentation is available at
211211
You need an OpenTok API key and API secret, which you can obtain by logging into your
212212
[TokBox account](https://tokbox.com/account).
213213

214-
The OpenTok PHP SDK requires PHP 5.3 or greater.
214+
The OpenTok PHP SDK requires PHP 5.6+ or PHP 7+
215+
216+
For PHP 5.5 and lower please use PHP SDK v2.5
215217

216218
# Release Notes
217219

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
"issues": "https://github.com/opentok/Opentok-PHP-SDK/issues"
2929
},
3030
"require": {
31-
"php": ">=5.0.0",
31+
"php": ">=5.6.0",
3232
"guzzle/guzzle": "~3.7",
33-
"aoberoi/json-works": "~1.0",
34-
"firebase/php-jwt": "^4.0"
33+
"johnstevenson/json-works": "~1.1",
34+
"firebase/php-jwt": "^5.0"
3535
},
3636
"require-dev": {
37-
"phpunit/phpunit": "~4.1",
38-
"phing/phing": "~2.15.2"
37+
"phpunit/phpunit": "~5.7",
38+
"phing/phing": "~2.16.0"
3939
},
4040
"autoload": {
4141
"psr-4": {

src/OpenTok/Util/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
// TODO: build this dynamically
2525
/** @internal */
26-
define('OPENTOK_SDK_VERSION', '2.5.1');
26+
define('OPENTOK_SDK_VERSION', '3.0.0');
2727
/** @internal */
2828
define('OPENTOK_SDK_USER_AGENT', 'OpenTok-PHP-SDK/' . OPENTOK_SDK_VERSION);
2929

tests/OpenTok/ArchiveTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function testStopsArchive()
112112
// TODO: test the dynamically built User Agent string
113113
$userAgent = $request->getHeader('User-Agent');
114114
$this->assertNotEmpty($userAgent);
115-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
115+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
116116

117117
// TODO: test the properties of the actual archive object
118118
$this->assertEquals('stopped', $this->archive->status);
@@ -154,7 +154,7 @@ public function testDeletesArchive()
154154
// TODO: test the dynamically built User Agent string
155155
$userAgent = $request->getHeader('User-Agent');
156156
$this->assertNotEmpty($userAgent);
157-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
157+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
158158

159159
$this->assertTrue($success);
160160
// TODO: assert that all properties of the archive object were cleared

tests/OpenTok/OpenTokTest.php

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ public function testCanBeInitialized()
5454
$this->assertInstanceOf('OpenTok\OpenTok', $this->opentok);
5555
}
5656

57-
/**
58-
* @expectedException PHPUnit_Framework_Error_Warning
59-
*/
6057
public function testFailsOnInvalidInitialization()
6158
{
59+
if (class_exists('ArgumentCountError')) {
60+
$this->expectException(ArgumentCountError::class);
61+
} else {
62+
$this->expectException(PHPUnit_Framework_Error_Warning::class);
63+
}
6264
// Arrange
6365
$opentok = new OpenTok();
6466
// Act
@@ -94,7 +96,7 @@ public function testCreatesDefaultSession()
9496
// TODO: test the dynamically built User Agent string
9597
$userAgent = $request->getHeader('User-Agent');
9698
$this->assertNotEmpty($userAgent);
97-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
99+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
98100

99101
$p2p_preference = $request->getPostField('p2p.preference');
100102
$this->assertEquals('enabled', $p2p_preference);
@@ -140,7 +142,7 @@ public function testCreatesMediaRoutedAndLocationSession()
140142
// TODO: test the dynamically built User Agent string
141143
$userAgent = $request->getHeader('User-Agent');
142144
$this->assertNotEmpty($userAgent);
143-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
145+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
144146

145147
$location = $request->getPostField('location');
146148
$this->assertEquals('12.34.56.78', $location);
@@ -188,7 +190,7 @@ public function testCreatesMediaRelayedSession()
188190
// TODO: test the dynamically built User Agent string
189191
$userAgent = $request->getHeader('User-Agent');
190192
$this->assertNotEmpty($userAgent);
191-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
193+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
192194

193195
$p2p_preference = $request->getPostField('p2p.preference');
194196
$this->assertEquals('enabled', $p2p_preference);
@@ -233,7 +235,7 @@ public function testCreatesAutoArchivedSession()
233235
// TODO: test the dynamically built User Agent string
234236
$userAgent = $request->getHeader('User-Agent');
235237
$this->assertNotEmpty($userAgent);
236-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
238+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
237239

238240
$archiveMode = $request->getPostField('archiveMode');
239241
$this->assertEquals('always', $archiveMode);
@@ -429,7 +431,7 @@ public function testStartsArchive()
429431
// TODO: test the dynamically built User Agent string
430432
$userAgent = $request->getHeader('User-Agent');
431433
$this->assertNotEmpty($userAgent);
432-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
434+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
433435

434436
$this->assertInstanceOf('OpenTok\Archive', $archive);
435437
$this->assertEquals(0, $archive->duration);
@@ -479,7 +481,7 @@ public function testStartsArchiveNamed()
479481
// TODO: test the dynamically built User Agent string
480482
$userAgent = $request->getHeader('User-Agent');
481483
$this->assertNotEmpty($userAgent);
482-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
484+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
483485

484486
$body = json_decode($request->getBody());
485487
$this->assertEquals($sessionId, $body->sessionId);
@@ -527,7 +529,7 @@ public function testStartsArchiveNamedDeprecated()
527529
// TODO: test the dynamically built User Agent string
528530
$userAgent = $request->getHeader('User-Agent');
529531
$this->assertNotEmpty($userAgent);
530-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
532+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
531533

532534
$body = json_decode($request->getBody());
533535
$this->assertEquals($sessionId, $body->sessionId);
@@ -574,7 +576,7 @@ public function testStartsArchiveAudioOnly()
574576
// TODO: test the dynamically built User Agent string
575577
$userAgent = $request->getHeader('User-Agent');
576578
$this->assertNotEmpty($userAgent);
577-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
579+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
578580

579581
$body = json_decode($request->getBody());
580582
$this->assertEquals($sessionId, $body->sessionId);
@@ -624,7 +626,7 @@ public function testStartsArchiveIndividualOutput()
624626
// TODO: test the dynamically built User Agent string
625627
$userAgent = $request->getHeader('User-Agent');
626628
$this->assertNotEmpty($userAgent);
627-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
629+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
628630

629631
$body = json_decode($request->getBody());
630632
$this->assertEquals($sessionId, $body->sessionId);
@@ -669,7 +671,7 @@ public function testStopsArchive()
669671
// TODO: test the dynamically built User Agent string
670672
$userAgent = $request->getHeader('User-Agent');
671673
$this->assertNotEmpty($userAgent);
672-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
674+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
673675

674676
$this->assertInstanceOf('OpenTok\Archive', $archive);
675677
// TODO: test the properties of the actual archive object
@@ -708,7 +710,7 @@ public function testGetsArchive()
708710
// TODO: test the dynamically built User Agent string
709711
$userAgent = $request->getHeader('User-Agent');
710712
$this->assertNotEmpty($userAgent);
711-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
713+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
712714

713715
$this->assertInstanceOf('OpenTok\Archive', $archive);
714716
// TODO: test the properties of the actual archive object
@@ -749,7 +751,7 @@ public function testDeletesArchive()
749751
// TODO: test the dynamically built User Agent string
750752
$userAgent = $request->getHeader('User-Agent');
751753
$this->assertNotEmpty($userAgent);
752-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
754+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
753755

754756
$this->assertTrue($success);
755757
// TODO: test the properties of the actual archive object
@@ -784,7 +786,7 @@ public function testListsArchives()
784786
// TODO: test the dynamically built User Agent string
785787
$userAgent = $request->getHeader('User-Agent');
786788
$this->assertNotEmpty($userAgent);
787-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
789+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
788790

789791
$this->assertInstanceOf('OpenTok\ArchiveList', $archiveList);
790792
// TODO: test the properties of the actual archiveList object and its contained archive
@@ -872,7 +874,7 @@ public function testForceDisconnect()
872874
// TODO: test the dynamically built User Agent string
873875
$userAgent = $request->getHeader('User-Agent');
874876
$this->assertNotEmpty($userAgent);
875-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
877+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
876878

877879
$this->assertTrue($success);
878880
}
@@ -914,7 +916,7 @@ public function testStartsBroadcast()
914916
// TODO: test the dynamically built User Agent string
915917
$userAgent = $request->getHeader('User-Agent');
916918
$this->assertNotEmpty($userAgent);
917-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
919+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
918920

919921
$this->assertInstanceOf('OpenTok\Broadcast', $broadcast);
920922
$this->assertInternalType('string', $broadcast->id);
@@ -959,7 +961,7 @@ public function testStopsBroadcast()
959961
// TODO: test the dynamically built User Agent string
960962
$userAgent = $request->getHeader('User-Agent');
961963
$this->assertNotEmpty($userAgent);
962-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
964+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
963965

964966
$this->assertInstanceOf('OpenTok\Broadcast', $broadcast);
965967
$this->assertTrue($broadcast->isStopped);
@@ -996,7 +998,7 @@ public function testGetsBroadcast()
996998
// TODO: test the dynamically built User Agent string
997999
$userAgent = $request->getHeader('User-Agent');
9981000
$this->assertNotEmpty($userAgent);
999-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
1001+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
10001002

10011003
$this->assertInstanceOf('OpenTok\Broadcast', $broadcast);
10021004
}
@@ -1040,7 +1042,7 @@ public function testUpdatesBroadcastLayoutWithPredefined()
10401042
// TODO: test the dynamically built User Agent string
10411043
$userAgent = $request->getHeader('User-Agent');
10421044
$this->assertNotEmpty($userAgent);
1043-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
1045+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
10441046
}
10451047

10461048
public function testUpdatesBroadcastLayoutWithCustom()
@@ -1086,7 +1088,7 @@ public function testUpdatesBroadcastLayoutWithCustom()
10861088
// TODO: test the dynamically built User Agent string
10871089
$userAgent = $request->getHeader('User-Agent');
10881090
$this->assertNotEmpty($userAgent);
1089-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
1091+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
10901092
}
10911093

10921094
public function testUpdatesStreamLayoutClassList()
@@ -1131,7 +1133,7 @@ public function testUpdatesStreamLayoutClassList()
11311133
// TODO: test the dynamically built User Agent string
11321134
$userAgent = $request->getHeader('User-Agent');
11331135
$this->assertNotEmpty($userAgent);
1134-
$this->assertStringStartsWith('OpenTok-PHP-SDK/2.5.1', $userAgent->__toString());
1136+
$this->assertStringStartsWith('OpenTok-PHP-SDK/3.0.0', $userAgent->__toString());
11351137
}
11361138

11371139

0 commit comments

Comments
 (0)