mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-03-13 05:26:57 +00:00
Get FilterTest passing again for now
This commit is contained in:
parent
5d5d5118ef
commit
21a6f431db
|
@ -274,7 +274,17 @@ class Filter
|
|||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
return $this->properties;
|
||||
return collect($this->properties)->merge(
|
||||
$this->conditions->flatten(1)->mapWithKeys(function (FilterCondition $condition) {
|
||||
$values = $condition->getValues();
|
||||
|
||||
return [
|
||||
$condition->getProperty() => $values->count() == 1
|
||||
? $values->first()
|
||||
: $values
|
||||
];
|
||||
})
|
||||
)->toArray();
|
||||
}
|
||||
|
||||
public function getConditions(): Collection
|
||||
|
|
|
@ -358,7 +358,7 @@ class FilterTest extends TestCase
|
|||
'shouldStar' => 'true',
|
||||
'shouldAlwaysMarkAsImportant' => 'true',
|
||||
],
|
||||
$this->filter->from(['foo@example.com ', 'bar@example.com'])
|
||||
$this->filter->from(['foo@example.com', 'bar@example.com'])
|
||||
->has('Something')
|
||||
->excludeChats()
|
||||
->labelAndArchive('Foo')
|
||||
|
|
Loading…
Reference in a new issue