|
|
@@ -32,7 +32,7 @@ class DolibarrApiServiceTest extends TestCase
|
|
|
$dolibarrApiService
|
|
|
->expects(self::once())
|
|
|
->method('getJsonContent')
|
|
|
- ->with("thirdparties", [ "limit" => "1", "sqlfilters" => "ref_int=" . $organizationId])
|
|
|
+ ->with("thirdparties", [ "limit" => "1", "sqlfilters" => "(ef.2iopen_organization_id:=:" . $organizationId . ')'])
|
|
|
->willReturn([['id' => 1]]); // dummy non-empty data
|
|
|
|
|
|
$society = $dolibarrApiService->getSociety($organizationId);
|
|
|
@@ -54,7 +54,7 @@ class DolibarrApiServiceTest extends TestCase
|
|
|
$dolibarrApiService
|
|
|
->expects(self::once())
|
|
|
->method('getJsonContent')
|
|
|
- ->with("contracts", ["limit" => "1", "sqlfilters" => "statut=1", "thirdparty_ids" => $socId])
|
|
|
+ ->with("contracts", ["limit" => "1", "sqlfilters" => "statut:=:1", "thirdparty_ids" => $socId])
|
|
|
->willReturn([['id' => 1]]); // dummy non-empty data
|
|
|
|
|
|
$this->assertEquals(['id' => 1], $dolibarrApiService->getActiveContract($socId));
|
|
|
@@ -74,7 +74,7 @@ class DolibarrApiServiceTest extends TestCase
|
|
|
$dolibarrApiService
|
|
|
->expects(self::once())
|
|
|
->method('getJsonContent')
|
|
|
- ->with("contracts", ["limit" => "1", "sqlfilters" => "statut=1", "thirdparty_ids" => $socId])
|
|
|
+ ->with("contracts", ["limit" => "1", "sqlfilters" => "statut:=:1", "thirdparty_ids" => $socId])
|
|
|
->willThrowException(new HttpException(404));
|
|
|
|
|
|
$this->assertEquals(null, $dolibarrApiService->getActiveContract($socId));
|
|
|
@@ -94,7 +94,7 @@ class DolibarrApiServiceTest extends TestCase
|
|
|
$dolibarrApiService
|
|
|
->expects(self::once())
|
|
|
->method('getJsonContent')
|
|
|
- ->with("contracts", ["limit" => "1", "sqlfilters" => "statut=1", "thirdparty_ids" => $socId])
|
|
|
+ ->with("contracts", ["limit" => "1", "sqlfilters" => "statut:=:1", "thirdparty_ids" => $socId])
|
|
|
->willThrowException(new HttpException(500));
|
|
|
|
|
|
$this->expectException(HttpException::class);
|
|
|
@@ -116,7 +116,7 @@ class DolibarrApiServiceTest extends TestCase
|
|
|
$dolibarrApiService
|
|
|
->expects(self::once())
|
|
|
->method('getJsonContent')
|
|
|
- ->with("invoices", ["sortfield" => "datef", "sortorder" => "DESC", "limit" => 5, "sqlfilters" => "fk_soc=" . $socId])
|
|
|
+ ->with("invoices", ["sortfield" => "datef", "sortorder" => "DESC", "limit" => 5, "sqlfilters" => "fk_soc:=:" . $socId])
|
|
|
->willReturn([['id' => 10], ['id' => 20]]);
|
|
|
|
|
|
$this->assertEquals([['id' => 10], ['id' => 20]], $dolibarrApiService->getBills($socId));
|
|
|
@@ -136,7 +136,7 @@ class DolibarrApiServiceTest extends TestCase
|
|
|
$dolibarrApiService
|
|
|
->expects(self::once())
|
|
|
->method('getJsonContent')
|
|
|
- ->with("invoices", ["sortfield" => "datef", "sortorder" => "DESC", "limit" => 5, "sqlfilters" => "fk_soc=" . $socId])
|
|
|
+ ->with("invoices", ["sortfield" => "datef", "sortorder" => "DESC", "limit" => 5, "sqlfilters" => "fk_soc:=:" . $socId])
|
|
|
->willThrowException(new HttpException(404));
|
|
|
|
|
|
$this->assertEquals([], $dolibarrApiService->getBills($socId));
|
|
|
@@ -156,7 +156,7 @@ class DolibarrApiServiceTest extends TestCase
|
|
|
$dolibarrApiService
|
|
|
->expects(self::once())
|
|
|
->method('getJsonContent')
|
|
|
- ->with("invoices", ["sortfield" => "datef", "sortorder" => "DESC", "limit" => 5, "sqlfilters" => "fk_soc=" . $socId])
|
|
|
+ ->with("invoices", ["sortfield" => "datef", "sortorder" => "DESC", "limit" => 5, "sqlfilters" => "fk_soc:=:" . $socId])
|
|
|
->willThrowException(new HttpException(500));
|
|
|
|
|
|
$this->expectException(HttpException::class);
|
|
|
@@ -177,7 +177,7 @@ class DolibarrApiServiceTest extends TestCase
|
|
|
$dolibarrApiService
|
|
|
->expects(self::once())
|
|
|
->method('getJsonContent')
|
|
|
- ->with("thirdparties", ["limit" => "1000000", "sqlfilters" => "client=1"])
|
|
|
+ ->with("thirdparties", ["limit" => "1000000", "sqlfilters" => "client:=:1"])
|
|
|
->willReturn([['id' => 10], ['id' => 20]]);
|
|
|
|
|
|
$this->assertEquals([['id' => 10], ['id' => 20]], $dolibarrApiService->getAllClients());
|
|
|
@@ -262,7 +262,7 @@ class DolibarrApiServiceTest extends TestCase
|
|
|
$dolibarrApiService
|
|
|
->expects(self::once())
|
|
|
->method('getJsonContent')
|
|
|
- ->with("contacts?limit=1000&t.statut=1&thirdparty_ids=" . $socId . "&sqlfilters=(te.2iopen_person_id%3A%3E%3A0)")
|
|
|
+ ->with("contacts?limit=1000&t.statut=1&thirdparty_ids=" . $socId . "&sqlfilters:=:(te.2iopen_person_id%3A%3E%3A0)")
|
|
|
->willReturn([['id' => 10], ['id' => 20]]);
|
|
|
|
|
|
$this->assertEquals([['id' => 10], ['id' => 20]], $dolibarrApiService->getActiveOpentalentContacts($socId));
|
|
|
@@ -282,7 +282,7 @@ class DolibarrApiServiceTest extends TestCase
|
|
|
$dolibarrApiService
|
|
|
->expects(self::once())
|
|
|
->method('getJsonContent')
|
|
|
- ->with("contacts?limit=1000&t.statut=1&thirdparty_ids=" . $socId . "&sqlfilters=(te.2iopen_person_id%3A%3E%3A0)")
|
|
|
+ ->with("contacts?limit=1000&t.statut=1&thirdparty_ids=" . $socId . "&sqlfilters:=:(te.2iopen_person_id%3A%3E%3A0)")
|
|
|
->willThrowException(new HttpException(404));
|
|
|
|
|
|
$this->assertEquals([], $dolibarrApiService->getActiveOpentalentContacts($socId));
|
|
|
@@ -302,7 +302,7 @@ class DolibarrApiServiceTest extends TestCase
|
|
|
$dolibarrApiService
|
|
|
->expects(self::once())
|
|
|
->method('getJsonContent')
|
|
|
- ->with("contacts?limit=1000&t.statut=1&thirdparty_ids=" . $socId . "&sqlfilters=(te.2iopen_person_id%3A%3E%3A0)")
|
|
|
+ ->with("contacts?limit=1000&t.statut=1&thirdparty_ids=" . $socId . "&sqlfilters:=:(te.2iopen_person_id%3A%3E%3A0)")
|
|
|
->willThrowException(new HttpException(500));
|
|
|
|
|
|
$this->expectException(HttpException::class);
|