Skip to content

Commit

Permalink
0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Jun 4, 2017
1 parent dfa5cca commit d438cd9
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 2 deletions.
64 changes: 63 additions & 1 deletion T/Basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function t01_users() {
echo df_dump(df_json_decode($c->request()->getBody()));
}

/** @test 2017-06-03 */
/** 2017-06-03 */
function t02_customers() {
/** @var C $c */
$c = (new C)
Expand All @@ -32,4 +32,66 @@ function t02_customers() {
]));
echo df_dump(df_json_decode($c->request()->getBody()));
}

/**
* 2017-06-04
* «How to apply a filter to a «get list» Web API request?» https://oplatform.club/t/103
*/
function t03_orders() {
/** @var C $c */
$c = (new C)
->setConfig(['timeout' => 120])
->setHeaders(['content-type' => 'application/json'] + df_oro_headers())
->setMethod(C::GET)
->setUri("https://localhost.com:848/app_dev.php/api/extenddforders?filter[product]=1")
;
$c->setAdapter((new \Zend_Http_Client_Adapter_Socket)->setStreamContext([
'ssl' => ['allow_self_signed' => true, 'verify_peer' => false]
]));
echo df_json_encode_pretty(df_json_decode($c->request()->getBody()));
}

/**
* 2017-06-04
* «What is the difference beetween the «application/json» and «application/vnd.api+json»
* content types of a Web API response?» https://oplatform.club/t/104
*/
function t04_orders_vnd() {
/** @var C $c */
$c = (new C)
->setConfig(['timeout' => 120])
->setHeaders([
'accept' => 'application/vnd.api+json'
,'content-type' => 'application/vnd.api+json'
] + df_oro_headers())
->setMethod(C::GET)
->setUri("https://localhost.com:848/app_dev.php/api/extenddforders?filter[product]=1")
;
$c->setAdapter((new \Zend_Http_Client_Adapter_Socket)->setStreamContext([
'ssl' => ['allow_self_signed' => true, 'verify_peer' => false]
]));
echo df_json_encode_pretty(df_json_decode($c->request()->getBody()));
}

/** @test
* 2017-06-04
* How to apply a filter to a «get list» Web API request?
* Inclusion Filters: https://www.orocrm.com/documentation/2.0/book/data-api#inclusion-filter-include
*/
function t05_orders_include() {
/** @var C $c */
$c = (new C)
->setConfig(['timeout' => 120])
->setHeaders([
'accept' => 'application/vnd.api+json'
,'content-type' => 'application/vnd.api+json'
] + df_oro_headers())
->setMethod(C::GET)
->setUri("https://localhost.com:848/app_dev.php/api/extenddforders?filter[product]=1&include=product,website")
;
$c->setAdapter((new \Zend_Http_Client_Adapter_Socket)->setStreamContext([
'ssl' => ['allow_self_signed' => true, 'verify_peer' => false]
]));
echo df_json_encode_pretty(df_json_decode($c->request()->getBody()));
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage2pro/oro"
,"version": "0.0.2"
,"version": "0.0.3"
,"description": "A custom integration between Magento 2 and Oro Platform."
,"type": "magento2-module"
,"homepage": "https://ocrm.pro"
Expand Down

0 comments on commit d438cd9

Please sign in to comment.