summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json37
-rwxr-xr-xphp-doctrine-dbal-get-source.sh4
-rw-r--r--php-doctrine-dbal-phpunit54.patch22
-rw-r--r--php-doctrine-dbal.spec42
4 files changed, 94 insertions, 11 deletions
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..7b10ef5
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,37 @@
+{
+ "name": "doctrine/dbal",
+ "type": "library",
+ "description": "Database Abstraction Layer",
+ "keywords": ["dbal", "database", "persistence", "queryobject"],
+ "homepage": "http://www.doctrine-project.org",
+ "license": "MIT",
+ "authors": [
+ {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"},
+ {"name": "Roman Borschel", "email": "roman@code-factory.org"},
+ {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"},
+ {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}
+ ],
+ "require": {
+ "php": ">=5.3.2",
+ "doctrine/common": ">=2.4,<2.7-dev"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.*",
+ "symfony/console": "2.*||^3.0"
+ },
+ "suggest": {
+ "symfony/console": "For helpful console commands such as SQL execution and import of files."
+ },
+ "bin": ["bin/doctrine-dbal"],
+ "autoload": {
+ "psr-0": { "Doctrine\\DBAL\\": "lib/" }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.5.x-dev"
+ }
+ },
+ "archive": {
+ "exclude": ["!vendor", "tests", "*phpunit.xml", ".travis.yml", "build.xml", "build.properties", "composer.phar"]
+ }
+}
diff --git a/php-doctrine-dbal-get-source.sh b/php-doctrine-dbal-get-source.sh
index e283587..f8f69e8 100755
--- a/php-doctrine-dbal-get-source.sh
+++ b/php-doctrine-dbal-get-source.sh
@@ -37,6 +37,8 @@ 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..."
@@ -45,6 +47,7 @@ pushd $TEMP_DIR
pushd $GIT_DIR
print "Checking out commit..."
$GIT checkout $GIT_COMMIT
+ cp composer.json $CMP_FILE
popd
TAR_DIR=${GIT_NAME}-${GIT_COMMIT}
@@ -52,7 +55,6 @@ pushd $TEMP_DIR
mv $GIT_DIR $TAR_DIR
- TAR_FILE=`$RPM --eval='%{_sourcedir}'`/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz
print "TAR_FILE = $TAR_FILE"
[ -e $TAR_FILE ] && rm -f $TAR_FILE
diff --git a/php-doctrine-dbal-phpunit54.patch b/php-doctrine-dbal-phpunit54.patch
new file mode 100644
index 0000000..8c53d09
--- /dev/null
+++ b/php-doctrine-dbal-phpunit54.patch
@@ -0,0 +1,22 @@
+--- tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php.old 2016-06-13 17:57:43.021134891 +0200
++++ tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php 2016-06-13 17:57:47.140157022 +0200
+@@ -275,7 +275,8 @@
+
+ $this->_sm->dropAndCreateTable($table);
+
+- $listenerMock = $this->getMock('ListTableColumnsDispatchEventListener', array('onSchemaColumnDefinition'));
++ $listenerMock = $this->getMockObjectGenerator()->getMock('ListTableColumnsDispatchEventListener', array('onSchemaColumnDefinition'));
++ $this->registerMockObject($listenerMock);
+ $listenerMock
+ ->expects($this->exactly(7))
+ ->method('onSchemaColumnDefinition');
+@@ -300,7 +301,8 @@
+
+ $this->_sm->dropAndCreateTable($table);
+
+- $listenerMock = $this->getMock('ListTableIndexesDispatchEventListener', array('onSchemaIndexDefinition'));
++ $listenerMock = $this->getMockObjectGenerator()->getMock('ListTableIndexesDispatchEventListener', array('onSchemaIndexDefinition'));
++ $this->registerMockObject($listenerMock);
+ $listenerMock
+ ->expects($this->exactly(3))
+ ->method('onSchemaIndexDefinition');
diff --git a/php-doctrine-dbal.spec b/php-doctrine-dbal.spec
index 35ad0a3..1922bce 100644
--- a/php-doctrine-dbal.spec
+++ b/php-doctrine-dbal.spec
@@ -13,8 +13,8 @@
%global github_owner doctrine
%global github_name dbal
-%global github_version 2.5.4
-%global github_commit abbdfd1cff43a7b99d027af3be709bc8fc7d4769
+%global github_version 2.5.5
+%global github_commit 9f8c05cd5225a320d56d4bfdb4772f10d045a0c9
%global composer_vendor doctrine
%global composer_project dbal
@@ -25,9 +25,9 @@
# NOTE: Min version not 2.4 because autoloader required
%global doctrine_common_min_ver 2.5.0
%global doctrine_common_max_ver 2.7
-# "symfony/console": "2.*"
+# "symfony/console": "2.*||^3.0"
%global symfony_console_min_ver 2.0
-%global symfony_console_max_ver 3.0
+%global symfony_console_max_ver 4
%{!?phpdir: %global phpdir %{_datadir}/php}
@@ -57,6 +57,9 @@ Source1: %{name}-get-source.sh
# 2) Auto-load using Doctrine\Common\ClassLoader
Patch0: %{name}-bin.patch
+# Fix test suite using PHPUnit 5.4
+Patch1: %{name}-phpunit54.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
# Tests
@@ -69,7 +72,7 @@ BuildRequires: php-composer(doctrine/common) < %{doctrine_common_max_ver}
## composer.json (optional)
BuildRequires: php-composer(symfony/console) >= %{symfony_console_min_ver}
BuildRequires: php-composer(symfony/console) < %{symfony_console_max_ver}
-## phpcompatinfo (computed from version 2.5.4)
+## phpcompatinfo (computed from version 2.5.5)
BuildRequires: php-date
BuildRequires: php-json
BuildRequires: php-pcre
@@ -85,7 +88,7 @@ Requires: php-composer(doctrine/common) < %{doctrine_common_max_ver}
# composer.json (optional)
Requires: php-composer(symfony/console) >= %{symfony_console_min_ver}
Requires: php-composer(symfony/console) < %{symfony_console_max_ver}
-# phpcompatinfo (computed from version 2.5.4)
+# phpcompatinfo (computed from version 2.5.5)
Requires: php-date
Requires: php-json
Requires: php-pcre
@@ -121,6 +124,10 @@ Autoloader: %{phpdir}/Doctrine/DBAL/autoload.php
: Patch bin script
%patch0 -p1
+if %{_bindir}/phpunit --atleast-version 5.4; then
+%patch1 -p0
+fi
+
: Remove empty file
rm -f lib/Doctrine/DBAL/README.markdown
@@ -182,11 +189,20 @@ $fedoraClassLoader->addPrefix(
);
BOOTSTRAP
-%{_bindir}/phpunit
-
-if which php70; then
- php70 %{_bindir}/phpunit
+run=0
+ret=0
+if which php56; then
+ php56 %{_bindir}/phpunit || ret=1
+ run=1
fi
+if which php71; then
+ php71 %{_bindir}/phpunit || ret=1
+ run=1
+fi
+if [ $run -eq 0 ]; then
+%{_bindir}/phpunit --verbose
+fi
+exit $ret
%else
: Tests skipped
%endif
@@ -207,6 +223,12 @@ rm -rf %{buildroot}
%changelog
+* Mon Sep 26 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.5.5-1
+- Updated to 2.5.5 (RHBZ #1374891)
+
+* Mon Jun 13 2016 Remi Collet <remi@fedoraproject.org> - 2.5.4-2
+- add workaround for test suite with PHPUnit 5.4
+
* Mon Mar 14 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.5.4-1
- Updated to 2.5.4 (RHBZ #1153987)
- Added autoloader