Skip to content

2.1

Compare
Choose a tag to compare
@DenTray DenTray released this 01 Aug 04:47
· 288 commits to master since this release
658187a

BREAKING CHANGES

  • removed filterByList method
  • assertMailEquals method now works with the mailable class which implements Illuminate\Contracts\Queue\ShouldQueue interface

FEATURES

New search filters processing

Any field, passed to the search method will be interpreted as a search filter without calling filterBy method

//UserService

public function search($filters)
{
    return $this
        ->searchQuery($filters)
        ->getSearchResults()
}

protected function getByRole($roleId)
{
    return $this->search(['role_id' => $roleId]); //will return search by role_id match $roleId
}

There are other reserved filter postfix that will be proceed automatically:

  • _from
  • _to
  • _in_list
  • _not_in_list

And reserved filter names:

  • with
  • with_count
$service->search([
    'with' => ['role'],
    'with_count' => ['mentors'],
    'salary_from' => 100,
    'started_at_from' => '2022-01-01',
    'status_in_list' = ['active', 'pending'],
    'type_not_in_list' => ['new', 'legacy']
]);

To skip filter from the automatically processing - please call setAdditionalReservedFilters method

//UserRepository.php

public function __construct()
{
    $this->setAdditionalReservedFilters('only_mentors', 'with_geo_data');
}

Global export mode

To enable global export mode inside the all tests, just call setGlobalExportMode method in your base TestCase setUp method.

In this mode - all assertEqualsFixture methods will export the data to the fixture before the assert.

What's Changed

New Contributors

Full Changelog: 1.5.2...2.1