Skip to content

Add PHPUnit to require-dev #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ matrix:
- php: hhvm

before_script:
- composer install --dev --prefer-source
- composer install

script:
- phpunit --coverage-text
- vendor/bin/phpunit --coverage-text
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,18 @@ See also the [examples](examples).
* gzip content encoding
* keep-alive connections
* following redirections

## Tests

To run the test suite, you first need to clone this repo and then install all
dependencies [through Composer](https://getcomposer.org):

```bash
$ composer install
```

To run the test suite, go to the project root and run:

```bash
$ php vendor/bin/phpunit
```
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"react/promise": "~2.2",
"evenement/evenement": "~2.0"
},
"require-dev": {
"phpunit/phpunit": "^5.0 || ^4.8.10"
},
"autoload": {
"psr-4": {
"React\\HttpClient\\": "src"
Expand Down
7 changes: 5 additions & 2 deletions tests/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public function setUp()
->disableOriginalConstructor()
->getMock();

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

$this->response = $this->getMockBuilder('React\HttpClient\Response')
->disableOriginalConstructor()
Expand Down Expand Up @@ -386,7 +387,9 @@ public function pipeShouldPipeDataIntoTheRequestBody()
->method('__invoke')
->will($this->returnValue($this->response));

$loop = $this->getMock('React\EventLoop\LoopInterface');
$loop = $this
->getMockBuilder('React\EventLoop\LoopInterface')
->getMock();

$request->setResponseFactory($factory);

Expand Down
2 changes: 1 addition & 1 deletion tests/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ResponseTest extends TestCase

public function setUp()
{
$this->stream = $this->getMockbuilder('React\Stream\Stream')
$this->stream = $this->getMockBuilder('React\Stream\Stream')
->disableOriginalConstructor()
->getMock();
}
Expand Down
4 changes: 3 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ protected function expectCallableNever()

protected function createCallableMock()
{
return $this->getMock('React\Tests\HttpClient\CallableStub');
return $this
->getMockBuilder('React\Tests\HttpClient\CallableStub')
->getMock();
}
}
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy