Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.3' ]
php: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4' ]
php: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]

steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
vendor/*
.phpdoc
doc/
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Removed all Cart v1 code and references (obsolete/legacy functionality removed).
- Made test tooling and CI compatible with PHP 7.1 through 8.3:
- Relaxed `phpunit/phpunit`, `phpunit/php-timer` and `php-mock/php-mock-phpunit` version constraints to allow Composer to resolve compatible test libraries per PHP runtime.
- Updated GitHub Actions matrix to run tests on PHP 7.1–8.3 and removed Docker-based CI job.


## [7.0.7] - 2025-01-21
### Fixed
- Fixed RequestException constructor to properly handle integer error codes
Expand Down
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Dockerfile for php-doofinder tests
ARG PHP_VERSION=7.4
FROM php:${PHP_VERSION}-cli

# Install system deps (Composer, extensions)
RUN apt-get update && apt-get install -y \
git unzip libcurl4-openssl-dev pkg-config libxml2-dev \
&& docker-php-ext-install curl dom \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy composer files first for better caching
COPY composer.json composer.lock ./

# Install dependencies
RUN composer install --no-scripts --dev --optimize-autoloader

# Copy source code
COPY . .

# Default command: run tests
CMD ["composer", "tests"]
60 changes: 60 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Makefile for php-doofinder testing with Docker
# Usage: make <target> (e.g., make install, make test)

# Variables
PHP_VERSION ?= 8.3
IMAGE_BASE ?= php-doofinder
COMPOSER_IMAGE ?= composer:latest

# Install Composer dependencies (dev mode)
install:
docker run --rm -v $(PWD):/app -w /app $(COMPOSER_IMAGE) install --no-scripts --dev

# Update composer.lock using Composer update (defaults to PHP 8.3)
update-lock:
docker run --rm -v $(PWD):/app -w /app $(COMPOSER_IMAGE) update --prefer-dist --no-interaction --no-progress

# Build custom Docker image (if using Dockerfile)
# Tags images as: php-doofinder-<version>
build:
docker build --build-arg PHP_VERSION=$(PHP_VERSION) -t $(IMAGE_BASE)-$(PHP_VERSION) .

# Run tests (builds image with dependencies)
test: build
docker run --rm $(IMAGE_BASE)-$(PHP_VERSION)

# Run tests via Composer script
test-composer:
docker run --rm -v $(PWD):/app -w /app $(IMAGE_BASE)-$(PHP_VERSION) composer tests

# Clean vendor/ (for branch switches)
clean:
rm -rf vendor/

# Full cycle: clean, install, test
ci: clean install test

# Test all supported PHP versions (7.1, 7.4 and 8.3)
test-all:
@for version in 7.1 7.4 8.3; do \
echo "Testing PHP $$version..."; \
make test PHP_VERSION=$$version; \
done

# Specific convenience targets to run tests for 7.4 and 8.3
# They build and run a local image named `php-doofinder-<version>`
test-7.4:
@$(MAKE) test PHP_VERSION=7.4

test-8.3:
@$(MAKE) test PHP_VERSION=8.3

# Lint/check (if you add later; placeholder)
lint:
@echo "No linter defined; add php-cs-fixer or similar if needed"

# Generate documentation
docs:
docker run --rm -v $(PWD):/app -w /app $(IMAGE_BASE)-$(PHP_VERSION) php phpDocumentor.phar -d src/ -t doc/

.PHONY: install build test test-composer clean ci lint docs test-7.4 test-8.3 test-5.6 test-all
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@
}
},
"require-dev": {
"phpunit/phpunit": "5.*",
"php-mock/php-mock-phpunit": "1.1.*"
"phpunit/phpunit": ">=4.8 <11.0",
"phpunit/php-timer": ">=1.0 <3.0",
"php-mock/php-mock-phpunit": ">=1.0 <4.0"
},
"scripts": {
"remove-documentation": "rm -rf doc/*",
Expand Down
Loading