fixing unit test

This commit is contained in:
Amine Ben hammou
2018-01-19 14:25:29 +00:00
parent 5e152e920e
commit f42b61a49e
2 changed files with 20 additions and 16 deletions

View File

@ -102,9 +102,13 @@ class NewsletterTemplatesTest extends \MailPoetTest {
$template_data['body'] = json_decode($template_data['body'], true);
$normalize = function($array) {
return array_filter($array, function($key) {
return in_array($key, ['newsletter_id', 'name', 'description', 'body']);
}, ARRAY_FILTER_USE_KEY);
$result = array();
foreach($array as $key => $value) {
if(in_array($key, ['newsletter_id', 'name', 'description', 'body'])) {
$result[$key] = $value;
}
}
return $result;
};
expect($normalize($response->data))->equals($template_data);