Release 2.40.0 (#5621)
This commit is contained in:
@@ -68,7 +68,7 @@ abstract class APIControllerBaseTestCase extends AbstractControllerBaseTestCase
|
||||
|
||||
$data = [
|
||||
'message' => 'Unauthorized',
|
||||
'code' => 401
|
||||
'code' => Response::HTTP_UNAUTHORIZED
|
||||
];
|
||||
|
||||
self::assertEquals(
|
||||
@@ -100,7 +100,7 @@ abstract class APIControllerBaseTestCase extends AbstractControllerBaseTestCase
|
||||
]);
|
||||
}
|
||||
|
||||
public function request(HttpKernelBrowser $client, string $url, string $method = 'GET', array $parameters = [], string $content = null): Crawler
|
||||
public function request(HttpKernelBrowser $client, string $url, string $method = 'GET', array $parameters = [], ?string $content = null): Crawler
|
||||
{
|
||||
$server = ['HTTP_CONTENT_TYPE' => 'application/json', 'CONTENT_TYPE' => 'application/json'];
|
||||
|
||||
@@ -276,6 +276,7 @@ abstract class APIControllerBaseTestCase extends AbstractControllerBaseTestCase
|
||||
$fieldName = implode('.', $parts);
|
||||
}
|
||||
|
||||
self::assertIsString($fieldName);
|
||||
self::assertArrayHasKey($fieldName, $data, \sprintf('Could not find validation error for field "%s" in list: %s', $fieldName, implode(', ', $failedFields)));
|
||||
self::assertArrayHasKey('errors', $data[$fieldName], \sprintf('Field %s has no validation problem', $fieldName));
|
||||
foreach ($messages as $i => $message) {
|
||||
@@ -356,6 +357,7 @@ abstract class APIControllerBaseTestCase extends AbstractControllerBaseTestCase
|
||||
'enabled' => 'bool',
|
||||
'apiToken' => 'bool',
|
||||
'color' => '@string',
|
||||
'avatar' => '@string',
|
||||
'alias' => '@string',
|
||||
'accountNumber' => '@string',
|
||||
'initials' => '@string',
|
||||
@@ -431,6 +433,9 @@ abstract class APIControllerBaseTestCase extends AbstractControllerBaseTestCase
|
||||
'color' => '@string',
|
||||
'number' => '@string',
|
||||
'comment' => '@string',
|
||||
'currency' => 'string', // since 2.40.0
|
||||
'country' => 'string', // since 2.40.0
|
||||
'company' => '@string', // since 2.40.0
|
||||
];
|
||||
|
||||
// if a list of customers is loaded
|
||||
@@ -446,6 +451,13 @@ abstract class APIControllerBaseTestCase extends AbstractControllerBaseTestCase
|
||||
'metaFields' => ['result' => 'array', 'type' => 'CustomerMeta'],
|
||||
'teams' => ['result' => 'array', 'type' => 'Team'],
|
||||
'currency' => 'string', // since 1.10
|
||||
'country' => 'string',
|
||||
'company' => '@string',
|
||||
'homepage' => '@string',
|
||||
'fax' => '@string',
|
||||
'mobile' => '@string',
|
||||
'phone' => '@string',
|
||||
'timezone' => 'string',
|
||||
];
|
||||
|
||||
// if a customer is loaded explicitly
|
||||
@@ -490,6 +502,8 @@ abstract class APIControllerBaseTestCase extends AbstractControllerBaseTestCase
|
||||
'orderNumber' => '@string',
|
||||
'globalActivities' => 'bool',
|
||||
'comment' => '@string',
|
||||
'start' => '@datetime',
|
||||
'end' => '@datetime',
|
||||
];
|
||||
|
||||
// if a project is embedded in an expanded collection (here timesheet)
|
||||
@@ -505,6 +519,8 @@ abstract class APIControllerBaseTestCase extends AbstractControllerBaseTestCase
|
||||
'orderNumber' => '@string',
|
||||
'globalActivities' => 'bool',
|
||||
'comment' => '@string',
|
||||
'start' => '@datetime',
|
||||
'end' => '@datetime',
|
||||
];
|
||||
|
||||
// if a collection of projects is loaded
|
||||
|
||||
Reference in New Issue
Block a user