-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
85 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace BoletoSimples; | ||
|
||
class Extra { | ||
public static function userinfo() { | ||
$response = BaseResource::sendRequest('GET', 'userinfo'); | ||
return $response->json(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
class ExtraTest extends PHPUnit_Framework_TestCase { | ||
/** | ||
* @before | ||
*/ | ||
public function setupSomeFixtures() | ||
{ | ||
BoletoSimples::configure(['environment' => 'sandbox']); | ||
} | ||
|
||
/** | ||
* @vcr extra/userinfo | ||
* ATENÇÃO: Após apagar a fixture extra/userinfo e rodar o teste denovo, | ||
* edite o arquivo e remova o token do login_url por questão de segurança. | ||
*/ | ||
public function testUserinfo() { | ||
$this->subject = BoletoSimples\Extra::userinfo(); | ||
$this->assertEquals(array_keys($this->subject), ["id","login_url","email","account_type","first_name","middle_name","last_name","full_name","cpf","date_of_birth","mother_name","father_name","account_level","phone_number","address_street_name","address_number","address_complement","address_neighborhood","address_postal_code","address_city_name","address_state","business_name","business_cnpj","business_legal_name"]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
- | ||
request: | ||
method: GET | ||
url: 'https://sandbox.boletosimples.com.br/api/v1/userinfo' | ||
headers: | ||
Host: sandbox.boletosimples.com.br | ||
Accept-Encoding: null | ||
Content-Type: application/json | ||
User-Agent: 'BoletoSimples PHP Client v0.0.2 ([email protected])' | ||
Authorization: 'Bearer BOLETOSIMPLES_ACCESS_TOKEN' | ||
Accept: null | ||
response: | ||
status: | ||
http_version: '1.1' | ||
code: '200' | ||
message: OK | ||
headers: | ||
Server: Cowboy | ||
Connection: keep-alive | ||
Strict-Transport-Security: max-age=2592000 | ||
Content-Type: 'application/json; charset=utf-8' | ||
X-Ratelimit-Limit: '500' | ||
X-Ratelimit-Remaining: '496' | ||
Etag: 'W/"2d2f54e118a16fc72383e7533ebcfeb1"' | ||
Cache-Control: 'must-revalidate, private, max-age=0' | ||
X-Request-Id: f3a2b980-ba43-4b51-a61f-81b5f5159c29 | ||
X-Runtime: '0.072303' | ||
Date: 'Sun, 08 Mar 2015 18:14:55 GMT' | ||
X-Rack-Cache: miss | ||
Vary: Accept-Encoding | ||
Transfer-Encoding: chunked | ||
Via: '1.1 vegur' | ||
body: '{"id":53,"login_url":"https://sandbox.boletosimples.com.br/welcome?email=user1%40example.com\u0026token=xxx","email":"[email protected]","account_type":null,"first_name":null,"middle_name":null,"last_name":null,"full_name":null,"cpf":null,"date_of_birth":null,"mother_name":null,"father_name":null,"account_level":2,"phone_number":null,"address_street_name":null,"address_number":null,"address_complement":null,"address_neighborhood":null,"address_postal_code":null,"address_city_name":null,"address_state":null,"business_name":null,"business_cnpj":null,"business_legal_name":null}' |