Merge branch 'master' of https://github.com/alchemy-fr/Phraseanet into PHRAS-2375-port41-preview-pdf-on-pdfjs

This commit is contained in:
aina-esokia
2019-01-25 15:13:00 +04:00
33 changed files with 197 additions and 73 deletions

View File

@@ -37,7 +37,8 @@ jobs:
- run: git clone https://github.com/alanxz/rabbitmq-c
- run: cd rabbitmq-c && git checkout 2ca1774489328cde71195f5fa95e17cf3a80cb8a
- run: cd rabbitmq-c && git submodule init && git submodule update && autoreconf -i && ./configure && make && sudo make install
- run: pecl channel-update pear.php.net
# disabled because pear.php.net is down cause of security failure
#- run: pecl channel-update pear.php.net
- run: yes '' | pecl install amqp-1.9.3
- run: yes '' | pecl install imagick
- run: sudo apt-get install libzmq-dev

View File

@@ -50,7 +50,7 @@
"alchemy/embed-bundle": "^0.3.4",
"alchemy/geonames-api-consumer": "~0.1.0",
"alchemy/mediavorus": "^0.4.4",
"alchemy/oauth2php": "1.0.0",
"alchemy/oauth2php": "1.1.0",
"alchemy/phlickr": "0.2.9",
"alchemy/phpexiftool": "^0.7.0",
"alchemy/rest-bundle": "^0.0.5",

53
composer.lock generated
View File

@@ -1,10 +1,10 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "253990d4c81f9ae5f78c6c1221d6cf29",
"content-hash": "adf4074eb26ea80d414430d4f7b61311",
"packages": [
{
"name": "alchemy-fr/tcpdf-clone",
@@ -275,16 +275,16 @@
},
{
"name": "alchemy/mediavorus",
"version": "0.4.8",
"version": "0.4.9",
"source": {
"type": "git",
"url": "https://github.com/alchemy-fr/MediaVorus.git",
"reference": "6a50c397211dfdf6da108ea1ebc7527c37419ab7"
"reference": "1a96dc4142ff8474c11285cab9eab11df9683255"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/alchemy-fr/MediaVorus/zipball/6a50c397211dfdf6da108ea1ebc7527c37419ab7",
"reference": "6a50c397211dfdf6da108ea1ebc7527c37419ab7",
"url": "https://api.github.com/repos/alchemy-fr/MediaVorus/zipball/1a96dc4142ff8474c11285cab9eab11df9683255",
"reference": "1a96dc4142ff8474c11285cab9eab11df9683255",
"shasum": ""
},
"require": {
@@ -333,20 +333,20 @@
"keywords": [
"metadata"
],
"time": "2018-05-03T14:17:10+00:00"
"time": "2019-01-22T11:23:34+00:00"
},
{
"name": "alchemy/oauth2php",
"version": "1.0.0",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/alchemy-fr/oauth2-php.git",
"reference": "cb4fcb73e30ab54e0fb85a65b4d57147f7a0df15"
"reference": "801510972240555fa182813851efd96659d37a68"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/alchemy-fr/oauth2-php/zipball/cb4fcb73e30ab54e0fb85a65b4d57147f7a0df15",
"reference": "cb4fcb73e30ab54e0fb85a65b4d57147f7a0df15",
"url": "https://api.github.com/repos/alchemy-fr/oauth2-php/zipball/801510972240555fa182813851efd96659d37a68",
"reference": "801510972240555fa182813851efd96659d37a68",
"shasum": ""
},
"type": "library",
@@ -356,7 +356,7 @@
]
},
"notification-url": "https://packagist.org/downloads/",
"time": "2013-07-01T09:46:59+00:00"
"time": "2019-01-17T14:34:10+00:00"
},
{
"name": "alchemy/phlickr",
@@ -1898,12 +1898,12 @@
"version": "v2.5.6",
"source": {
"type": "git",
"url": "https://github.com/doctrine/doctrine2.git",
"url": "https://github.com/doctrine/orm.git",
"reference": "e6c434196c8ef058239aaa0724b4aadb0107940b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/doctrine2/zipball/e6c434196c8ef058239aaa0724b4aadb0107940b",
"url": "https://api.github.com/repos/doctrine/orm/zipball/e6c434196c8ef058239aaa0724b4aadb0107940b",
"reference": "e6c434196c8ef058239aaa0724b4aadb0107940b",
"shasum": ""
},
@@ -2304,12 +2304,12 @@
"version": "v2.2.1",
"source": {
"type": "git",
"url": "https://github.com/google/google-api-php-client.git",
"url": "https://github.com/googleapis/google-api-php-client.git",
"reference": "b69b8ac4bf6501793c389d4e013a79d09c85c5f2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/google/google-api-php-client/zipball/b69b8ac4bf6501793c389d4e013a79d09c85c5f2",
"url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/b69b8ac4bf6501793c389d4e013a79d09c85c5f2",
"reference": "b69b8ac4bf6501793c389d4e013a79d09c85c5f2",
"shasum": ""
},
@@ -2363,12 +2363,12 @@
"version": "v0.36",
"source": {
"type": "git",
"url": "https://github.com/google/google-api-php-client-services.git",
"url": "https://github.com/googleapis/google-api-php-client-services.git",
"reference": "2fd7d2876fbc0174faddba3241956a1393536159"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/google/google-api-php-client-services/zipball/2fd7d2876fbc0174faddba3241956a1393536159",
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/2fd7d2876fbc0174faddba3241956a1393536159",
"reference": "2fd7d2876fbc0174faddba3241956a1393536159",
"shasum": ""
},
@@ -2400,12 +2400,12 @@
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/google/google-auth-library-php.git",
"url": "https://github.com/googleapis/google-auth-library-php.git",
"reference": "548d27d670f0236dc5258fa4cdde6e7b63464cfd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/google/google-auth-library-php/zipball/548d27d670f0236dc5258fa4cdde6e7b63464cfd",
"url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/548d27d670f0236dc5258fa4cdde6e7b63464cfd",
"reference": "548d27d670f0236dc5258fa4cdde6e7b63464cfd",
"shasum": ""
},
@@ -5766,17 +5766,6 @@
{
"name": "roave/security-advisories",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git",
"reference": "3db4b0df21d1f527304650e717c66af48981f1c4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/3db4b0df21d1f527304650e717c66af48981f1c4",
"reference": "3db4b0df21d1f527304650e717c66af48981f1c4",
"shasum": ""
},
"conflict": {
"adodb/adodb-php": "<5.20.6",
"amphp/artax": ">=2,<2.0.4|>0.7.1,<1.0.4",
@@ -6015,6 +6004,7 @@
"keywords": [
"microframework"
],
"abandoned": "symfony/flex",
"time": "2016-01-06T14:59:35+00:00"
},
{
@@ -6060,6 +6050,7 @@
],
"description": "A WebProfiler for Silex",
"homepage": "http://silex.sensiolabs.org/",
"abandoned": true,
"time": "2016-01-10T11:39:13+00:00"
},
{

View File

@@ -7,6 +7,7 @@ main:
languages: []
key: ''
api_require_ssl: true
api_token_header: false
database:
host: 127.0.0.1
port: 3306

View File

@@ -16,7 +16,7 @@ class Version
/**
* @var string
*/
private $number = '4.1.0-alpha.13b';
private $number = '4.1.0-alpha.14a';
/**
* @var string

View File

@@ -89,7 +89,6 @@ class Field implements Typed
case databox_field::TYPE_NUMBER:
return FieldMapping::TYPE_DOUBLE;
case databox_field::TYPE_STRING:
case databox_field::TYPE_TEXT:
return FieldMapping::TYPE_STRING;
}

View File

@@ -537,7 +537,11 @@ class API_OAuth2_Adapter extends OAuth2
public function verifyAccessToken($scope = null, $exit_not_present = true, $exit_invalid = true, $exit_expired = true, $exit_scope = true, $realm = null)
{
$token_param = $this->getAccessTokenParams();
$apiTokenHeader = $this->app['conf']->get(['main', 'api_token_header']);
$useTokenHeader = $this->useTokenHeaderChoice($apiTokenHeader);
$token_param = $this->getAccessTokenParams($useTokenHeader);
// Access token was not provided
if ($token_param === false) {
@@ -808,4 +812,21 @@ class API_OAuth2_Adapter extends OAuth2
return false;
}
}
/**
* Get the correct constante to call on Oauth2
*
* @param $apiTokenHeader
* @return string
*/
private function useTokenHeaderChoice($apiTokenHeader)
{
if ($apiTokenHeader === true) {
return Oauth2::TOKEN_ONLY_IN_HEADER;
} elseif ($apiTokenHeader === false) {
return Oauth2::TOKEN_ONLY_IN_GETPOST;
} else {
return Oauth2::TOKEN_AUTO_FIND;
}
}
}

View File

@@ -446,7 +446,6 @@ class databox extends base implements ThumbnailedElement
databox_field::TYPE_DATE
, databox_field::TYPE_NUMBER
, databox_field::TYPE_STRING
, databox_field::TYPE_TEXT
]
) ? $type : databox_field::TYPE_STRING;

View File

@@ -100,7 +100,6 @@ class databox_field implements cache_cacheableInterface
protected $original_dces;
protected $aggregable;
const TYPE_TEXT = "text";
const TYPE_DATE = "date";
const TYPE_STRING = "string";
const TYPE_NUMBER = "number";

View File

@@ -0,0 +1,64 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2016 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Alchemy\Phrasea\Application;
class patch_410alpha14a implements patchInterface
{
/** @var string */
private $release = '4.1.0-alpha.14a';
/** @var array */
private $concern = [base::DATA_BOX];
/**
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return [];
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function apply(base $databox, Application $app)
{
$sql = "UPDATE metadatas_structure SET type = 'string' where type = 'text' OR type = '' ";
$databox->get_connection()->executeQuery($sql);
return true;
}
}

View File

@@ -1901,7 +1901,7 @@
</field>
<field>
<name>type</name>
<type>enum('string','text','date','number')</type>
<type>enum('string','date','number')</type>
<null></null>
<extra></extra>
<default></default>

View File

@@ -198,7 +198,7 @@
<Coverage src="XMP-dc:Coverage" report="1" />
<Rights src="XMP-dc:Rights" report="0" />
<Comments src="" business="1" report="0" />
<Filename src="Phraseanet:tf-basename" readonly="1" type="text" report="1"/>
<Filename src="Phraseanet:tf-basename" readonly="1" type="string" report="1"/>
<CameraDevice src="IFD0:Model" readonly="1" report="0" />
<Latitude src="GPS:GPSLatitude" readonly="1" report="0" />
<Longitude src="GPS:GPSLongitude" readonly="1" report="0"/>

View File

@@ -202,7 +202,7 @@
<Longitude src="GPS:GPSLongitude" readonly="1"/>
<Latitude src="GPS:GPSLatitude" readonly="1"/>
<CameraModel src="IFD0:Model" readonly="1"/>
<FileName src="Phraseanet:tf-basename" readonly="1" type="text" />
<FileName src="Phraseanet:tf-basename" readonly="1" type="string" />
</description>
<statbits>

View File

@@ -202,7 +202,7 @@
<Longitude src="GPS:GPSLongitude" readonly="1"/>
<Latitude src="GPS:GPSLatitude" readonly="1"/>
<AppareilPhoto src="IFD0:Model" readonly="1"/>
<NomDeFichier src="Phraseanet:tf-basename" readonly="1" type="text" />
<NomDeFichier src="Phraseanet:tf-basename" readonly="1" type="string" />
</description>
<statbits>

View File

@@ -60,7 +60,7 @@
chdir: /vagrant/
- name: Create ElasticSearch indexes
shell: php bin/console s:i:c
shell: php bin/console searchengine:index -c
args:
chdir: /vagrant/

View File

@@ -18,6 +18,10 @@
with_items: '{{ server.packages }}'
when: server.packages is defined
- name: Pip install ndg-httpsclient
shell: pip install ndg-httpsclient
sudo: yes
- name: Configure the timezone
sudo: yes
template: src=timezone.j2 dest=/etc/timezone

View File

@@ -21,6 +21,13 @@ server:
- xpdf
- libav-tools
- gpac
- python
- python-urllib3
- python3-openssl
- python-pyasn1
- python-pyasn1-modules
- python3-pyasn1
- python-pip
timezone: UTC
locales:
- en_GB.UTF-8

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

View File

@@ -130,7 +130,6 @@
<select id="type">
<option <%= field.type == '' ? 'selected' : '' %> value=""></option>
<option <%= field.type == 'string' ? 'selected' : '' %> value="string">string</option>
<option <%= field.type == 'text' ? 'selected' : '' %> value="text">text</option>
<option <%= field.type == 'number' ? 'selected' : '' %> value="number">number</option>
<option <%= field.type == 'date' ? 'selected' : '' %> value="date">date</option>
</select>

View File

@@ -136,50 +136,67 @@
<tbody>
<tr>
<td>
<div class="context-menu context-menu-theme-vista">
<div class="context-menu context-menu-theme-flat">
<div title="" class="context-menu-item">
<div class="context-menu-item-inner export-record-action"
data-kind="basket" data-id="{{basket.getId()}}">{{ 'action::exporter' | trans }}
data-kind="basket" data-id="{{basket.getId()}}">
<a href="#">
<img src="/assets/common/images/icons/export-shadow.png" style="width: 22px;" alt="{{ 'action::exporter' | trans }}">
<span>{{ 'action::exporter' | trans }}</span>
</a>
</div>
</div>
<div title="" class="context-menu-item">
<div class="context-menu-item-inner">
<a href="{{ path('lightbox_compare', { 'basket' : basket.getId() }) }}" target="_blank">Lightbox</a>
<a href="{{ path('lightbox_compare', { 'basket' : basket.getId() }) }}" target="_blank">
<img src="/assets/lightbox/images/lightbox-icon.png" style="width: 20px; box-shadow: 0 2px 2px rgba(0,0,0,.2);" alt="{{ 'Lightbox' | trans }}">
<span>{{ 'Lightbox' | trans }}</span>
</a>
</div>
</div>
<div title="" class="context-menu-item">
<div class="context-menu-item-inner">
<a class="basket-update-action" data-basket-id="{{ basket.getId() }}" title="{{ 'action::renommer' | trans }}" href="#">
{{ 'action::renommer' | trans }}
<img src="/assets/common/images/icons/rename.png" style="width: 26px; margin-left: -2px; margin-right: -2px;" alt="{{ 'action::renommer' | trans }}">
<span>{{ 'action::renommer' | trans }}</span>
</a>
</div>
</div>
{% if basket.getValidation() %}
<div title="" class="context-menu-item">
<a target="_blank" href="{{ path('lightbox_validation', { 'basket' : basket.getId() }) }}">
<div class="context-menu-item-inner">
{{ 'action::Valider' | trans }}
</div>
<a target="_blank" href="{{ path('lightbox_validation', { 'basket' : basket.getId() }) }}">
<img src="/assets/common/images/icons/basket_validation.png" style="width: 22px;" alt="{{ 'action::Valider' | trans }}">
<span>{{ 'action::Valider' | trans }}</span>
</a>
</div>
</div>
{% endif %}
<div title="" class="context-menu-item">
<div class="context-menu-item-inner basket-archive-action" data-basket-id="{{ basket.getId() }}" >
{{ 'Archive' | trans }}
</div>
</div>
<div title="" class="context-menu-item">
<div class="context-menu-item-inner basket-delete-action" id="SSTTREMOVER_{{basket.getId()}}" data-context="SSTT">
{{ 'action : supprimer' | trans }}
<a href="#">
<img src="/assets/common/images/icons/archive.png" style="width: 26px; margin-left: -2px; margin-right: -2px;" alt="{{ 'Archive' | trans }}">
<span>{{ 'Archive' | trans }}</span>
</a>
</div>
</div>
<div title="" class="context-menu-item">
<div class="context-menu-item-inner">
<a class="basket-reorder-content-action" data-basket-id="{{ basket.getId() }}" title="{{ 'Re-ordonner' | trans }}" href="#">
{{ 'Re-ordonner' | trans }}
<img src="/assets/common/images/icons/set-order.png" style="width: 26px; margin-left: -2px; margin-right: -2px;" alt="{{ 'Re-ordonner' | trans }}">
<span>{{ 'Re-ordonner' | trans }}</span>
</a>
</div>
</div>
<div title="" class="context-menu-item">
<div class="context-menu-item-inner basket-delete-action" id="SSTTREMOVER_{{basket.getId()}}" data-context="SSTT">
<a href="#">
<img src="/assets/common/images/icons/delete.png" style="width: 22px;" alt="{{ 'action : supprimer' | trans }}">
<span>{{ 'action : supprimer' | trans }}</span>
</a>
</div>
</div>
@@ -222,24 +239,33 @@
<tbody>
<tr>
<td>
<div class="context-menu context-menu-theme-vista">
<div class="context-menu context-menu-theme-flat">
<div title="" class="context-menu-item">
<div class="context-menu-item-inner export-record-action"
data-kind="record" data-id="{{story.getRecord(app).get_serialize_key()}}">{{ 'action::exporter' | trans }}
data-kind="record" data-id="{{story.getRecord(app).get_serialize_key()}}">
<a href="#">
<img src="/assets/common/images/icons/export-shadow.png" style="width: 22px;" alt="{{ 'action::exporter' | trans }}">
<span>{{ 'action::exporter' | trans }}</span>
</a>
</div>
</div>
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANMODIFRECORD')) %}
<div title="" class="context-menu-item menu3-custom-item">
<div class="context-menu-item-inner edit-record-action"
data-kind="record" data-id="{{story.getRecord(app).get_serialize_key()}}"
>{{ 'action::editer' | trans }}
>
<a href="#">
<img src="/assets/common/images/icons/edit-pen.png" style="width: 22px;" alt="{{ 'action::editer' | trans }}">
<span>{{ 'action::editer' | trans }}</span>
</a>
</div>
</div>
{% endif %}
<div title="" class="context-menu-item menu3-custom-item">
<div class="context-menu-item-inner">
<a class="story_unfix" href="{{ path('prod_workzone_detach_story', { 'sbas_id' : story.getRecord(app).get_sbas_id(), 'record_id' : story.getRecord(app).get_record_id()}) }}">
{{ 'action::detacher' | trans }}
<img src="/assets/common/images/icons/detach.png" style="width: 26px; margin-left: -2px; margin-right: 2px;" alt="{{ 'action::detacher' | trans }}">
<span style="margin-left: 4px;">{{ 'action::detacher' | trans }}</span>
</a>
</div>
</div>
@@ -249,7 +275,8 @@
data-db-id="{{ story.getRecord(app).get_sbas_id }}"
data-record-id="{{ story.getRecord(app).get_record_id() }}"
href="#">
{{ 'Re-ordonner' | trans }}
<img src="/assets/common/images/icons/set-order.png" style="width: 26px; margin-left: -2px; margin-right: -2px;" alt="{{ 'Re-ordonner' | trans }}">
<span>{{ 'Re-ordonner' | trans }}</span>
</a>
</div>
</div>

View File

@@ -111,25 +111,34 @@
<tbody>
<tr>
<td>
<div class="context-menu context-menu-theme-vista">
<div class="context-menu context-menu-theme-flat">
{% if granted_on_collection(record.baseId, [constant('\\ACL::CANPUTINALBUM')]) and not record.story %}
<div title="" class="context-menu-item">
<div class="context-menu-item-inner record-add-to-basket-action" data-db-id="{{record.databoxId}}" data-record-id="{{record.recordId}}">
{{ 'action : ajouter au panier' | trans }}
<a title="{{ 'action : ajouter au panier' | trans }}" href="#">
<img style="cursor:pointer;" src="/assets/common/images/icons/basket-1.png" alt="{{ 'action : ajouter au panier' | trans }}">
<span>{{ 'action : ajouter au panier' | trans }}</span>
</a>
</div>
</div>
{% endif %}
{% if granted_on_collection(record.baseId, [constant('\\ACL::CANDWNLDPREVIEW')]) or granted_on_collection(record.baseId, [constant('\\ACL::CANDWNLDHD')]) %}
<div title="" class="context-menu-item">
<div class="context-menu-item-inner record-export-action" data-kind="record" data-id="{{record.id}}">
{{ 'action : exporter' | trans }}
<a title="{{ 'action : exporter' | trans }}" href="#">
<img style="cursor:pointer;" src="/assets/common/images/icons/export-shadow.png" alt="{{ 'action : exporter' | trans }}">
<span>{{ 'action : exporter' | trans }}</span>
</a>
</div>
</div>
{% endif %}
<div title="" class="context-menu-item">
<div class="context-menu-item-inner record-print-action"
data-kind="record" data-id="{{record.id}}">
{{ 'action : print' | trans }}
<a title="{{ 'action : print' | trans }}" href="#">
<img style="cursor:pointer;" src="/assets/common/images/icons/print-shadow.png" alt="{{ 'action : print' | trans }}">
<span>{{ 'action : print' | trans }}</span>
</a>
</div>
</div>
{% if app['conf'].get(['registry', 'actions', 'social-tools']) == 'all'
@@ -138,7 +147,10 @@
{% if record.story is empty %}
<div title="" class="context-menu-item">
<div class="context-menu-item-inner share-record-action" data-db="{{record.baseId}}" data-record-id="{{record.recordId}}">
{{ 'reponses:: partager' | trans }}
<a title="{{ 'reponses:: partager' | trans }}" href="#">
<img style="cursor:pointer;" src="/assets/common/images/icons/Share.png" alt="{{ 'reponses:: partager' | trans }}">
<span>{{ 'reponses:: partager' | trans }}</span>
</a>
</div>
</div>
{% endif %}

View File

@@ -742,7 +742,7 @@ class ApiJsonTest extends ApiTestCase
}
$this->assertTrue(is_string($metadatas['thesaurus_branch']));
$this->assertTrue(in_array($metadatas['type'], [\databox_field::TYPE_DATE, \databox_field::TYPE_STRING, \databox_field::TYPE_NUMBER, \databox_field::TYPE_TEXT]));
$this->assertTrue(in_array($metadatas['type'], [\databox_field::TYPE_DATE, \databox_field::TYPE_STRING, \databox_field::TYPE_NUMBER]));
$this->assertTrue(is_bool($metadatas['indexable']));
$this->assertTrue(is_bool($metadatas['multivalue']));
$this->assertTrue(is_bool($metadatas['readonly']));