Skip to content
This repository has been archived by the owner on Dec 17, 2022. It is now read-only.

Commit

Permalink
Code quality, makefile added
Browse files Browse the repository at this point in the history
  • Loading branch information
Brunty committed Apr 9, 2017
1 parent aeb653b commit ef72f41
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
19 changes: 18 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
Contributor Code of Conduct
### Getting started

The test case that this package provides is: `src/ApiTestCase.php`

There's a test for this test case, that is: `tests/ApiTestCaseTest.php`

### Testing, Quality & Code Coverage

When submitting a PR, please ensure that any new code is covered by tests and that code coverage does not drop, as well as abiding by standards set by the [Sensio Labs Insight](https://insight.sensiolabs.com) code quality tool.

To run the tests, use:

```bash
make test
```

### Contributor Code of Conduct

As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
vendor/bin/phpunit --coverage-html=build
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "brunty/api-testcase",
"description": "A testcase that extends PHPUnit to help with testing API endpoints.",
"description": "A testcase that extends PHPUnit to help with testing HTTP (mainly API) endpoints.",
"keywords": [
"phpunit",
"api",
"testcase"
"testcase",
"http"
],
"type": "library",
"license": "MIT",
Expand All @@ -20,7 +21,7 @@
}
},
"require": {
"php": "^7.0",
"php": "7.0.*||7.1.*",
"guzzlehttp/guzzle": "^6.2",
"spatie/array-to-xml": "^2.2",
"phpunit/phpunit": "^6.0"
Expand Down
5 changes: 1 addition & 4 deletions tests/ApiTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ public function it_asserts_the_response_is_xml()
{
$this->get('/xml');
$this->assertResponseWasXml();

$this->get('/response-headers?Content-Type=application/xml; charset=UTF-8');
$this->assertResponseWasXml();
}

/**
Expand Down Expand Up @@ -305,6 +302,6 @@ public function it_returns_the_response_and_status_code()
{
$this->get('/get');
self::assertInstanceOf(GuzzleResponse::class, $this->response());
self::assertEquals(Response::HTTP_OK, $this->statusCode());
self::assertSame(Response::HTTP_OK, $this->statusCode());
}
}

0 comments on commit ef72f41

Please sign in to comment.