diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-08-09 13:43:05 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-08-09 13:43:05 +0200 |
commit | 25d21c9c83923094c5b9a0512a8f8a40ddacb722 (patch) | |
tree | 835d5e13d23275611f2c85ba449e5a837139bbb8 | |
parent | 0a6bc0c7c1e6ea72343c53df61990798a249f56f (diff) |
php-behat-mink: 1.7.1 (backported from Fedora)
-rw-r--r-- | composer.json | 50 | ||||
-rwxr-xr-x | php-behat-mink-get-source.sh | 71 | ||||
-rw-r--r-- | php-behat-mink.spec | 88 |
3 files changed, 172 insertions, 37 deletions
diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..2ebdacb --- /dev/null +++ b/composer.json @@ -0,0 +1,50 @@ +{ + "name": "behat/mink", + "description": "Browser controller/emulator abstraction for PHP", + "keywords": ["web", "testing", "browser"], + "homepage": "http://mink.behat.org/", + "type": "library", + "license": "MIT", + + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + + "require": { + "php": ">=5.3.1", + "symfony/css-selector": "~2.1|~3.0" + }, + + "require-dev": { + "symfony/phpunit-bridge": "~2.7|~3.0" + }, + + "suggest": { + "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", + "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", + "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", + "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" + }, + + "autoload": { + "psr-4": { + "Behat\\Mink\\": "src/" + } + }, + + "autoload-dev": { + "psr-4": { + "Behat\\Mink\\Tests\\": "tests" + } + }, + + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + } +} diff --git a/php-behat-mink-get-source.sh b/php-behat-mink-get-source.sh new file mode 100755 index 0000000..1d762fb --- /dev/null +++ b/php-behat-mink-get-source.sh @@ -0,0 +1,71 @@ +#/bin/sh + +GIT=`which git` +RPM=`which rpm` + +if [ -z "$GIT" ] +then + echo "ERROR: 'git' command not found" 1>&2 + exit 1 +elif [ -z "$RPM" ] +then + echo "ERROR: 'rpm' command not found" 1>&2 + exit 1 +fi + +function print { + echo -e "\e[0;33m>>>>> ${1}\e[0m" +} + +if [ -x "$1" ] +then + SPEC=$1 +else + SPEC=`ls *.spec | head -1` +fi + +NAME=`echo $SPEC | sed 's#\.spec##'` +VERSION=`egrep '%global\s*github_version' $SPEC | awk '{print $3}'` + +print "SPEC = $SPEC" +print "NAME = $NAME" + +GIT_OWNER=`egrep '%global\s*github_owner' $SPEC | awk '{print $3}'` +GIT_NAME=`egrep '%global\s*github_name' $SPEC | awk '{print $3}'` +GIT_COMMIT=`egrep '%global\s*github_commit' $SPEC | awk '{print $3}'` +GIT_REPO=https://github.com/${GIT_OWNER}/${GIT_NAME} +GIT_DIR=`echo $GIT_REPO | sed 's#.*/##'` + +print "GIT_OWNER = $GIT_OWNER" +print "GIT_NAME = $GIT_NAME" +print "GIT_COMMIT = $GIT_COMMIT" +print "GIT_REPO = $GIT_REPO" +print "GIT_DIR = $GIT_DIR" + +TEMP_DIR=$(mktemp --dir) +TAR_FILE=${PWD}/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz +CMP_FILE=${PWD}/composer.json + +pushd $TEMP_DIR + print "Cloning git repo..." + $GIT clone $GIT_REPO + + pushd $GIT_DIR + print "Checking out commit..." + $GIT checkout $GIT_COMMIT + cp composer.json $CMP_FILE + popd + + TAR_DIR=${GIT_NAME}-${GIT_COMMIT} + print "TAR_DIR = $TAR_DIR" + + mv $GIT_DIR $TAR_DIR + + print "TAR_FILE = $TAR_FILE" + + [ -e $TAR_FILE ] && rm -f $TAR_FILE + tar --exclude-vcs -czf $TAR_FILE $TAR_DIR + chmod 0644 $TAR_FILE +popd + +rm -rf $TEMP_DIR diff --git a/php-behat-mink.spec b/php-behat-mink.spec index 435455f..b0e526f 100644 --- a/php-behat-mink.spec +++ b/php-behat-mink.spec @@ -12,18 +12,18 @@ %global github_owner minkphp %global github_name Mink -%global github_version 1.7.0 -%global github_commit 6c129030ec2cc029905cf969a56ca8f087b2dfdf +%global github_version 1.7.1 +%global github_commit e6930b9c74693dff7f4e58577e1b1743399f3ff9 %global composer_vendor behat %global composer_project mink # "php": ">=5.3.1" %global php_min_ver 5.3.1 -# "symfony/css-selector": "~2.1" +# "symfony/css-selector": "~2.1|~3.0" # NOTE: Min version not 2.1 because autoloader required %global symfony_min_ver %{?el6:2.3.31}%{!?el6:2.7.1} -%global symfony_max_ver 3.0 +%global symfony_max_ver 4.0 # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} @@ -39,7 +39,11 @@ Summary: Browser controller/emulator abstraction for PHP Group: Development/Libraries License: MIT URL: http://mink.behat.org/ -Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz + +# GitHub export does not include tests. +# Run php-behat-mink-get-source.sh to create full source. +Source0: %{name}-%{github_version}-%{github_commit}.tar.gz +Source1: %{name}-get-source.sh # Modify driver testsuite bootstrap Patch0: %{name}-driver-testsuite-bootstrap.patch @@ -52,7 +56,7 @@ BuildArch: noarch BuildRequires: php(language) >= %{php_min_ver} BuildRequires: php-composer(phpunit/phpunit) BuildRequires: php-composer(symfony/css-selector) >= %{symfony_min_ver} -## phpcompatinfo (computed from version 1.7.0) +## phpcompatinfo (computed from version 1.7.1) BuildRequires: php-dom BuildRequires: php-gd BuildRequires: php-json @@ -69,7 +73,7 @@ BuildRequires: php-composer(symfony/class-loader) Requires: php(language) >= %{php_min_ver} Requires: php-composer(symfony/css-selector) >= %{symfony_min_ver} Requires: php-composer(symfony/css-selector) < %{symfony_max_ver} -# phpcompatinfo (computed from version 1.7.0) +# phpcompatinfo (computed from version 1.7.1) Requires: php-mbstring Requires: php-pcre Requires: php-spl @@ -130,32 +134,6 @@ Bootstrap: %{testsdir}/%{name}-driver-testsuite/boostrap.php %prep %setup -qn %{github_name}-%{github_commit} -: Create library autoloader -cat <<'AUTOLOAD' | tee src/autoload.php -<?php -/** - * Autoloader for %{name} and its' dependencies - * (created by %{name}-%{version}-%{release}). - * - * @return \Symfony\Component\ClassLoader\ClassLoader - */ - -if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) { - if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) { - require_once '%{phpdir}/Symfony/Component/ClassLoader/ClassLoader.php'; - } - - $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); - $fedoraClassLoader->register(); -} - -$fedoraClassLoader->addPrefix('Behat\\Mink\\', dirname(dirname(__DIR__))); - -require_once '%{phpdir}/Symfony/Component/CssSelector/autoload.php'; - -return $fedoraClassLoader; -AUTOLOAD - : Make PSR-0 driver testsuite tests # Separate "tests-psr0" and "tests" directories so driver testsuite users (other # packages) do not need to update their code @@ -183,7 +161,31 @@ AUTOLOAD %build -# Empty build section, nothing to build +: Create library autoloader +cat <<'AUTOLOAD' | tee src/autoload.php +<?php +/** + * Autoloader for %{name} and its' dependencies + * (created by %{name}-%{version}-%{release}). + * + * @return \Symfony\Component\ClassLoader\ClassLoader + */ + +if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) { + if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) { + require_once '%{phpdir}/Symfony/Component/ClassLoader/ClassLoader.php'; + } + + $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); + $fedoraClassLoader->register(); +} + +$fedoraClassLoader->addPrefix('Behat\\Mink\\', dirname(dirname(__DIR__))); + +require_once '%{phpdir}/Symfony/Component/CssSelector/autoload.php'; + +return $fedoraClassLoader; +AUTOLOAD %install @@ -218,11 +220,20 @@ sed -e 's/function testEscapedSelectors/function SKIP_testEscapedSelectors/' \ %endif : Run tests +run=0 +ret=0 +if which php56; then + php56 %{_bindir}/phpunit --bootstrap tests-psr0/autoload.php || ret=1 + run=1 +fi +if which php71; then + php71 %{_bindir}/phpunit --bootstrap tests-psr0/autoload.php || ret=1 + run=1 +fi +if [ $run -eq 0 ]; then %{_bindir}/phpunit --verbose --bootstrap tests-psr0/autoload.php - -if which php70; then - php70 %{_bindir}/phpunit --verbose --bootstrap tests-psr0/autoload.php fi +exit $ret %else : Tests skipped %endif @@ -247,6 +258,9 @@ rm -rf %{buildroot} %changelog +* Tue Aug 09 2016 Shawn Iwinski <shawn@iwin.ski> - 1.7.1-1 +- Updated to 1.7.1 (RHBZ #1314987) + * Tue Dec 1 2015 Remi Collet <remi@fedoraproject.org> - 1.7.0-1 - backport for remi repository |