PHP label filter

Drew Sears edited this page Sep 25, 2018 · 4 revisions

As an exercise in unit testing, and also a real project:

Write a PHP class that takes a set of labels, a boolean query that looks like a SQL where clause, and returns match success. Example labels:

{"tag": ["work", "current-sprint"], "priority": "medium"}

Example filter:

`priority` = 'high' or (`priority` in ('medium', 'low') and `tag` not in ('work', 'personal'))

Exercises:

  • Run it in a PHP 7 docker container
  • Write unit tests
  • Get server-side unit tests running via TravisCI
  • Be able to include the code in another project via Composer.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.