-
Notifications
You must be signed in to change notification settings - Fork 16
/
edit.php
33 lines (27 loc) · 911 Bytes
/
edit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
use ApidaePHP\Exception\ApidaeException;
$config = [];
require __DIR__ . "/requires.inc.php";
$client = new \ApidaePHP\Client($config);
/**
* Fill with some offers ID
* Key is the offer ID
* Value is the expected result
* The exemples below should be edited depending on your project owner (default expected results are meant for member 1157 / Apidae Tourisme)
*/
$offers = [
5163353 => 'Offer owned by project manager : Should be allowed',
5023027 => 'Offer masqued, but owned by project manager : Should be allowed',
1 => 'Offer does not exist : 404 / Exception',
];
echo '<pre>';
foreach ($offers as $offer => $expected) {
echo $offer . ' expected : ' . $expected . "\n";
try {
$response = $client->getEditAutorisation(['id' => $offer]);
echo $response;
} catch (Exception $e) {
echo $e->getMessage();
}
echo "\n" . '<hr />' . "\n";
}