Skip to content

Commit

Permalink
Merge pull request #17 from achmadhadikurnia/main
Browse files Browse the repository at this point in the history
Update: Readme
  • Loading branch information
achmadhadikurnia authored Feb 19, 2024
2 parents c221cf2 + ffe97b5 commit 66d7661
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 13 deletions.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,41 @@ php artisan vendor:publish --tag="siasn-api-config"

## Usage

Coming Soon
Get APIM Token

```bash
php artisan siasn:apim-token
```

Forget APIM Token

```bash
php artisan siasn:forget-token
```

Get data from endpoint

```bash
php artisan siasn:get
```

Post data to endpoint

```bash
php artisan siasn:post
```

Get SSO Token

```bash
php artisan siasn:sso-token
```

Forget SSO Token

```bash
php artisan siasn:token
```

## Testing

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"require-dev": {
"laravel/pint": "^1.0",
"nunomaduro/collision": "^7.8",
"nunomaduro/larastan": "^2.0.1",
"larastan/larastan": "^2.0.1",
"orchestra/testbench": "^8.8",
"pestphp/pest": "^2.20",
"pestphp/pest-plugin-arch": "^2.0",
Expand Down
3 changes: 1 addition & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
<env name="SIASN_SSO_PASSWORD" value=""/>
<env name="SIASN_CONST_INSTANSI_ID" value=""/>
<env name="SIASN_CONST_SATUAN_KERJA_ID" value=""/>
<env name="SIASN_CONST_PNS_ORANG_ID" value=""/>
<env name="SIASN_GET_REQUEST_ENDPOINT_TEST" value="https://apimws.bkn.go.id:8243/apisiasn/1.0/referensi/ref-unor"/>
<env name="SIASN_POST_REQUEST_ENDPOINT_TEST" value="https://apimws.bkn.go.id:8243/apisiasn/1.0/pns/data-utama-update"/>
<env name="PNS_ORANG_ID" value=""/>
</php>
</phpunit>
10 changes: 5 additions & 5 deletions tests/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
->assertSuccessful();
});

it('can post endpoint', function () {
$this->artisan('siasn:post', ['endpoint' => env('SIASN_POST_REQUEST_ENDPOINT_TEST')])
->expectsQuestion('Write the parameters in JSON form here', json_encode(['pns_orang_id' => env('PNS_ORANG_ID')]))
->assertSuccessful();
});
// it('can post endpoint', function () {
// $this->artisan('siasn:post', ['endpoint' => env('SIASN_POST_REQUEST_ENDPOINT_TEST')])
// ->expectsQuestion('Write the parameters in JSON form here', json_encode(['pns_orang_id' => env('PNS_ORANG_ID')]))
// ->assertSuccessful();
// });
8 changes: 4 additions & 4 deletions tests/PostRequestEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

use Kanekescom\Siasn\Api\Facades\Siasn;

it('can send post request endpoint', function () {
$response = Siasn::withSso()->post(env('SIASN_POST_REQUEST_ENDPOINT_TEST'), ['pns_orang_id' => env('PNS_ORANG_ID')]);
// it('can send post request endpoint', function () {
// $response = Siasn::withSso()->post(env('SIASN_POST_REQUEST_ENDPOINT_TEST'), ['pns_orang_id' => env('PNS_ORANG_ID')]);

expect($response->successful())->toBeTrue();
});
// expect($response->successful())->toBeTrue();
// });

0 comments on commit 66d7661

Please sign in to comment.