Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ composer.lock
vendor
phpunit.xml
.phpunit-watcher.yml
.phpunit.result.cache
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ composer require kapersoft/sharefile-api
## Usage
The first thing you need to do is get an OAuth2 key. Go to the [Get an API key](https://api.sharefile.com/rest/oauth2-request.aspx) section on the [ShareFile API site](https://api.sharefile.com/) to get this key.

With an OAuth2 key you can instantiate a `Kapersoft\Sharefile\Client`:
With an OAuth2 key you can instantiate a `Kapersoft\ShareFile\Client`:
```php
$client = new Client('hostname', 'client_id', 'secret', 'username', 'password');
```
Expand All @@ -52,8 +52,8 @@ Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recen

## Testing
In the `/tests`-folder are two tests defined:
- `TestClient.php` tests the `Kapersoft\Sharefile\Client`-class using mock Guzzle objects;
- `TestShareFileApi.php` tests the `Kapersoft\Sharefile\Client`-class using the live ShareFile API. To use this test fill in your ShareFile credentials under section `<PHP>` of the `phpunit.xml.dist`-file in the project root folder. Some tests need additional parameters to run. These parameters can be found in the first lines of the test.
- `TestClient.php` tests the `Kapersoft\ShareFile\Client`-class using mock Guzzle objects;
- `TestShareFileApi.php` tests the `Kapersoft\ShareFile\Client`-class using the live ShareFile API. To use this test fill in your ShareFile credentials under section `<PHP>` of the `phpunit.xml.dist`-file in the project root folder. Some tests need additional parameters to run. These parameters can be found in the first lines of the test.

## Security
If you discover any security related issues, please email kapersoft@gmail.com instead of using the issue tracker.
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@
}
],
"require": {
"php": "^7.0",
"php": ">=7.0",
"guzzlehttp/guzzle": "^6.2"
},
"require-dev": {
"larapack/dd": "1.*",
"mikey179/vfsStream": "^1.6",
"phpunit/phpunit": "6.4.x-dev"
"mikey179/vfsstream": "^1.6",
"phpunit/phpunit": ">=6.4"
},
"autoload": {
"psr-4": {
"Kapersoft\\Sharefile\\": "src"
"Kapersoft\\ShareFile\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Kapersoft\\Sharefile\\Test\\": "tests"
"Kapersoft\\ShareFile\\Test\\": "tests"
}
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Exception\ClientException;
use Kapersoft\Sharefile\Exceptions\BadRequest;
use Kapersoft\ShareFile\Exceptions\BadRequest;

/**
* Class Client.
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/BadRequest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Kapersoft\Sharefile\Exceptions;
namespace Kapersoft\ShareFile\Exceptions;

use Exception;
use Psr\Http\Message\ResponseInterface;
Expand Down
6 changes: 3 additions & 3 deletions tests/TestClient.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace Kapersoft\Sharefile\Test;
namespace Kapersoft\ShareFile\Test;

use GuzzleHttp\Middleware;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use org\bovigo\vfs\vfsStream;
use Kapersoft\Sharefile\Client;
use Kapersoft\ShareFile\Client;
use PHPUnit\Framework\TestCase;
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\Exception\ClientException;
Expand Down Expand Up @@ -44,7 +44,7 @@ class TestClient extends TestCase
*
* @return void
*/
public function setUp()
protected function setUp(): void
{
$this->vfsRoot = vfsStream::setup('home');
}
Expand Down
8 changes: 4 additions & 4 deletions tests/TestShareFileApi.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace Kapersoft\Sharefile\Test;
namespace Kapersoft\ShareFile\Test;

use org\bovigo\vfs\vfsStream;
use Kapersoft\Sharefile\Client;
use Kapersoft\ShareFile\Client;
use PHPUnit\Framework\TestCase;
use org\bovigo\vfs\vfsStreamFile;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\ConnectException;
use Kapersoft\Sharefile\Exceptions\BadRequest;
use Kapersoft\ShareFile\Exceptions\BadRequest;

/**
* Class TestClient.
Expand Down Expand Up @@ -39,7 +39,7 @@ class TestShareFileApi extends TestCase
*
* @return void
*/
public function setUp()
protected function setUp(): void
{
$this->vfsRoot = vfsStream::setup('home');
}
Expand Down