8000 Merge pull request #75 from jsor-labs/phpunit-require-dev · reactphp/http-client@d70adc7 · GitHub
[go: up one dir, main page]

Skip to content

Commit d70adc7

Browse files
authored
Merge pull request #75 from jsor-labs/phpunit-require-dev
Add PHPUnit to require-dev
2 parents 307d8f9 + b80578d commit d70adc7

File tree

6 files changed

+29
-6
lines changed

6 files changed

+29
-6
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ matrix:
1515
- php: hhvm
1616

1717
before_script:
18-
- composer install --dev --prefer-source
18+
- composer install
1919

2020
script:
21-
- phpunit --coverage-text
21+
- vendor/bin/phpunit --coverage-text

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,18 @@ See also the [examples](examples).
5959
* gzip content encoding
6060
* keep-alive connections
6161
* following redirections
62+
63+
## Tests
64+
65+
To run the test suite, you first need to clone this repo and then install all
66+
dependencies [through Composer](https://getcomposer.org):
67+
68+
```bash
69+
$ composer install
70+
```
71+
72+
To run the test suite, go to the project root and run:
73+
74+
```bash
75+
$ php vendor/bin/phpunit
76+
```

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"react/promise": "~2.2",
1414
"evenement/evenement": "~2.0"
1515
},
16+
"require-dev": {
17+
"phpunit/phpunit": "^5.0 || ^4.8.10"
18+
},
1619
"autoload": {
1720
"psr-4": {
1821
"React\\HttpClient\\": "src"

tests/RequestTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public function setUp()
2121
->disableOriginalConstructor()
2222
->getMock();
2323

24-
$this->connector = $this->getMock('React\SocketClient\ConnectorInterface');
24+
$this->connector = $this->getMockBuilder('React\SocketClient\ConnectorInterface')
25+
->getMock();
2526

2627
$this->response = $this->getMockBuilder('React\HttpClient\Response')
2728
->disableOriginalConstructor()
@@ -386,7 +387,9 @@ public function pipeShouldPipeDataIntoTheRequestBody()
386387
->method('__invoke')
387388
->will($this->returnValue($this->response));
388389

389-
$loop = $this->getMock('React\EventLoop\LoopInterface');
390+
$loop = $this
391+
->getMockBuilder('React\EventLoop\LoopInterface')
392+
->getMock();
390393

391394
$request->setResponseFactory($factory);
392395

tests/ResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ResponseTest extends TestCase
1111

1212
public function setUp()
1313
{
14-
$this->stream = $this->getMockbuilder('React\Stream\Stream')
14+
$this->stream = $this->getMockBuilder('React\Stream\Stream')
1515
->disableOriginalConstructor()
1616
->getMock();
1717
}

tests/TestCase.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ protected function expectCallableNever()
3636

3737
protected function createCallableMock()
3838
{
39-
return $this->getMock('React\Tests\HttpClient\CallableStub');
39+
return $this
40+
->getMockBuilder('React\Tests\HttpClient\CallableStub')
41+
->getMock();
4042
}
4143
}

0 commit comments

Comments
 (0)
0