@@ -11,10 +11,8 @@ $import = $abraApi->import()
1111 ->into ("billsofdelivery " )
1212 ->params ("docqueue_id " , "1000000001 " );
1313
14- Assert::same ('import?select=id ' , $ import ->getApiEndpoint ());
14+ Assert::same ('billsofdelivery/ import/receivedorders ?select=id ' , $ import ->getApiEndpoint ());
1515Assert::equal ([
16- "input_document_clsid " => "receivedorders " ,
17- "output_document_clsid " => "billsofdelivery " ,
1816 "input_documents " => "1000000001 " ,
1917 "params " => [
2018 "docqueue_id " => "1000000001 "
@@ -24,8 +22,6 @@ Assert::equal([
2422$ import ->params ("otherParam " , "otherValue " );
2523
2624Assert::equal ([
27- "input_document_clsid " => "receivedorders " ,
28- "output_document_clsid " => "billsofdelivery " ,
2925 "input_documents " => "1000000001 " ,
3026 "params " => [
3127 "docqueue_id " => "1000000001 " ,
@@ -43,11 +39,9 @@ $import = $abraApi->import()
4339 "otherParam " => "otherValue " ])
4440 ->outputDocumentData ("StoreDocQueue_ID " , "1000000001 " );
4541
46- Assert::same ('import?select=id,DisplayName+as+name ' , $ import ->getApiEndpoint ());
42+ Assert::same ('billsofdelivery/ import/receivedorders ?select=id,DisplayName+as+name ' , $ import ->getApiEndpoint ());
4743
4844Assert::equal ([
49- "input_document_clsid " => "receivedorders " ,
50- "output_document_clsid " => "billsofdelivery " ,
5145 "input_documents " => [
5246 "1000000001 " ,
5347 "2000000001 "
@@ -67,8 +61,6 @@ $import->outputDocumentData("SomeColumn", "SomeValue");
6761$ import ->outputDocumentData ([ "SomeColumn2 " => "SomeValue2 " ], [ "SomeColumn3 " => "SomeValue3 " ]);
6862
6963Assert::equal ([
70- "input_document_clsid " => "receivedorders " ,
71- "output_document_clsid " => "billsofdelivery " ,
7264 "input_documents " => [
7365 "1000000001 " ,
7466 "2000000001 "
@@ -88,12 +80,14 @@ Assert::equal([
8880// import row of some BO into existing row usign CLSID
8981$ import = $ abraApi ->import ()
9082 ->from ("OBSCO4S1BRD13FY1010DELDFKK " , [ "1000000001 " ])
91- ->into ("billsofdelivery " , "9000000001 " )
83+ ->into ("OBSCO4S1BRD13FY1010DELDFK2 " , "9000000001 " )
9284 ->params ("docqueue_id " , "1000000001 " );
9385
86+ Assert::same ('import?select=id ' , $ import ->getApiEndpoint ());
87+
9488Assert::equal ([
9589 "input_document_clsid " => "OBSCO4S1BRD13FY1010DELDFKK " ,
96- "output_document_clsid " => "billsofdelivery " ,
90+ "output_document_clsid " => "OBSCO4S1BRD13FY1010DELDFK2 " ,
9791 "output_document " => "9000000001 " ,
9892 "input_documents " => "1000000001 " ,
9993 "params " => [
@@ -106,17 +100,31 @@ Assert::equal([
106100Assert::exception (function () use ($ abraApi ) {
107101 $ abraApi ->import ()
108102 ->into ("storecards " )
109- ->getQuery ();
103+ ->execute ();
110104}, \Exception::class, 'You must specify ->from(string $bussinessObject, array $documentIds) and ->into(string $bussinessObject, ?string $documentId) to execute import query. ' );
111105
112106Assert::exception (function () use ($ abraApi ) {
113107 $ abraApi ->import ()
114108 ->from ("storecards " , [ "1000000001 " ])
115- ->getQuery ();
109+ ->execute ();
116110}, \Exception::class, 'You must specify ->from(string $bussinessObject, array $documentIds) and ->into(string $bussinessObject, ?string $documentId) to execute import query. ' );
117111
118112Assert::exception (function () use ($ abraApi ) {
119113 $ abraApi ->import ()
120114 ->from ("storecards " , [ "10000000 " ])
121- ->getQuery ();
122- }, \Exception::class, 'Documents are supposed to be array of Bussiness object ID´s (string with length of 10 characters) ' );
115+ ->execute ();
116+ }, \Exception::class, 'Documents are supposed to be array of Bussiness object ID´s (string with length of 10 characters) ' );
117+
118+ Assert::exception (function () use ($ abraApi ) {
119+ $ abraApi ->import ()
120+ ->from ("storecards " , [ "1000000001 " ])
121+ ->into ("OBSCO4S1BRD13FY1010DELDFK2 " )
122+ ->execute ();
123+ }, \Exception::class, 'You must specify both left and right importing manager bussiness objects either by ClsID or by API Bussiness object name. ' );
124+
125+ Assert::exception (function () use ($ abraApi ) {
126+ $ abraApi ->import ()
127+ ->from ("OBSCO4S1BRD13FY1010DELDFK2 " , [ "1000000001 " ])
128+ ->into ("storecards " )
129+ ->execute ();
130+ }, \Exception::class, 'You must specify both left and right importing manager bussiness objects either by ClsID or by API Bussiness object name. ' );
0 commit comments