Skip to content

Commit d937bcc

Browse files
authored
Merge pull request #19 from clue-labs/php
First class support for PHP 5.3 through PHP 7 and HHVM
2 parents 353b813 + 6961af7 commit d937bcc

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

.travis.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
language: php
2+
23
php:
34
- 5.3
5+
- 5.4
6+
- 5.5
47
- 5.6
8+
- 7
59
- hhvm
10+
11+
sudo: true
12+
613
env:
714
- QUASSEL_HOST=127.0.0.1:4242
15+
816
install:
917
- sudo apt-get -qq update && sudo apt-get --no-install-recommends -qq install -y quassel-core
10-
- composer install --prefer-source --no-interaction
18+
- composer install --no-interaction
19+
1120
script:
1221
- sudo /etc/init.d/quasselcore status || sudo /etc/init.d/quasselcore start
1322
- sudo /etc/init.d/quasselcore status || sleep 2
14-
- phpunit --coverage-text
23+
- vendor/bin/phpunit --coverage-text

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"clue/qdatastream": "~0.5.0"
2323
},
2424
"require-dev": {
25-
"clue/block-react": "~0.3.0"
25+
"clue/block-react": "^1.1",
26+
"phpunit/phpunit": "^4.8"
2627
}
2728
}

tests/FunctionalTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testCreateClient()
4848
$factory = new Factory(self::$loop);
4949
$promise = $factory->createClient(self::$host);
5050

51-
$client = Block\await($promise, self::$loop);
51+
$client = Block\await($promise, self::$loop, 10.0);
5252

5353
return $client;
5454
}
@@ -102,6 +102,9 @@ public function testSendClientLogin(Client $client, $message)
102102
$message = $this->awaitMessage($client);
103103
$this->assertEquals('ClientLoginAck', $message['MsgType']);
104104

105+
$message = $this->awaitMessage($client);
106+
$this->assertEquals('SessionInit', $message['MsgType']);
107+
105108
return $message;
106109
}
107110

@@ -127,7 +130,7 @@ public function testSendHeartBeat(Client $client)
127130

128131
$client->sendHeartBeatRequest($time);
129132

130-
$received = Block\await($promise, self::$loop);
133+
$received = Block\await($promise, self::$loop, 10.0);
131134

132135
$this->assertEquals($time, $received);
133136
}
@@ -143,7 +146,7 @@ public function testClose(Client $client)
143146

144147
$client->close();
145148

146-
return Block\await($promise, self::$loop);
149+
return Block\await($promise, self::$loop, 10.0);
147150
}
148151

149152
private function awaitMessage(Client $client)
@@ -153,6 +156,6 @@ private function awaitMessage(Client $client)
153156

154157
$client->once('error', $reject);
155158
$client->once('close', $reject);
156-
}), self::$loop);
159+
}), self::$loop, 10.0);
157160
}
158161
}

0 commit comments

Comments
 (0)