version: 2
references:
  test_library: &test_library
    run:
      name: Test Library
      command: |
        composer install --prefer-source --no-interaction
        ./vendor/phpunit/phpunit/phpunit

  default_test_job: &default_test_job
    parallelism: 1
    steps:
      - checkout
      - *test_library

jobs:
  test_library_7_2:
    <<: *default_test_job
    docker:
      - image: circleci/php:7.2-apache-node-browsers

  test_library_7_3:
    <<: *default_test_job
    docker:
      - image: circleci/php:7.3-apache-node-browsers

  test_library_7_4:
    <<: *default_test_job
    docker:
      - image: circleci/php:7.4-apache-node-browsers
    
workflows:
  version: 2
  build:
    jobs:
      - test_library_7_2
      - test_library_7_3
      - test_library_7_4
