Skip to content

Repository files navigation

PHP Driver

Fiscal printer driver implementation

Setup

composer install

Running Tests

Docker (Recommended)

# Build the image (once, or after composer.json changes)
docker build -t fp-moldova-test .

# Run tests — always uses current source code
docker run --rm -v "${PWD}:/app" fp-moldova-test

Local

php vendor/bin/phpunit tests/ --testdox

Structure

src/
  FpMoldovaDriver.php            # Main driver implementation
  SerialConnectionInterface.php  # Serial port abstraction
tests/
  FpMoldovaDriverTest.php        # 30 unit tests
  MockSerialConnection.php       # In-memory serial mock
Dockerfile                       # Test environment (PHP 8.2, Composer)
docker-entrypoint.sh             # Auto-runs composer install if vendor/ is missing

docker-entrypoint.sh is called by the container on startup. It checks whether vendor/autoload.php exists in the mounted directory — if not, it runs composer install before executing the test suite. This means the image never bakes in source code or dependencies; a fresh clone works without any manual setup step.

Technical Details

  • PHP: 8.2+

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages