#!/bin/sh

set -e
. ./testsuite/common.sh

testpkg='testsuite/data/pearpkg1'
testpecl='testsuite/data/peclpkg1'

sed -e "s@/usr/share/pkg-php-tools/overrides@${PWD}/share/pkg-php-tools/overrides@" \
    share/pkg-php-tools/scripts/phppkginfo > share/pkg-php-tools/scripts/phppkginfo.test
chmod u+x share/pkg-php-tools/scripts/phppkginfo.test

expect_equal "php share/pkg-php-tools/scripts/phppkginfo.test debian_deps '${testpkg}'" 'Depends: php5-common (>= 5.2.1), php-alpha (>= 1.0~a), php-alpha (<= 2.0~alpha3), php-beta (>= 1.0~b2), php-beta (<< 2.0~beta4), php-rc (>= 1.0~rc2), php-rc (<= 2.0~rc5), php-horde-alarm (>= 2.2.0), php-horde-alarm (<< 3.0.0~alpha1), phpunit (>= 1.1), phpunit (<= 1.9)
Recommends: php5-mysql'
expect_equal "php share/pkg-php-tools/scripts/phppkginfo.test debian_deps '${testpecl}'" "Depends: php5-common (>= 5.2.1), phpapi-$(php-config --phpapi)"

rm share/pkg-php-tools/scripts/phppkginfo.test
