#!/bin/bash

# Install composer if not present
if ! command -v composer &> /dev/null; then
    echo "Installing composer..."
    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    php composer-setup.php --install-dir=/usr/local/bin --filename=composer
    php -r "unlink('composer-setup.php');"
fi

# Install dependencies
composer install

# Verify PHPUnit installation
./vendor/bin/phpunit --version