Skip to content

Commit

Permalink
test with php 7.1 and 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Dec 6, 2017
1 parent e255e7c commit ec06ac0
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 42 deletions.
50 changes: 33 additions & 17 deletions .travis.yml
Expand Up @@ -5,6 +5,8 @@ php:
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2

sudo: false

Expand All @@ -13,40 +15,54 @@ cache:
- $HOME/.composer/cache/files

env:
- TRANSPORT=jackrabbit PACKAGE_VERSION=high
- TRANSPORT=doctrine_dbal PACKAGE_VERSION=high
global:
# on PHP 7.2 we get deprecations about using each. they come from old phpunit versions, but we don't update phpunit for the maintenance branch.
- SYMFONY_DEPRECATIONS_HELPER="/.*each.*/"
matrix:
- TRANSPORT=jackrabbit
- TRANSPORT=doctrine_dbal

matrix:
fast_finish: true
include:
- php: 5.3
env: TRANSPORT=doctrine_dbal COMPOSER_FLAGS="--prefer-lowest"
dist: precise
# composer fails to find a solution even though i think there should exist one
# - php: 5.3
# env: TRANSPORT=jackrabbit COMPOSER_FLAGS="--prefer-lowest"
- php: 7.0
env: TRANSPORT=doctrine_dbal SYMFONY_VERSION="2.7"
- php: 7.0
env: TRANSPORT=jackrabbit SYMFONY_VERSION="2.7"
- php: 7.0
env: TRANSPORT=doctrine_dbal SYMFONY_VERSION="2.8" PHPBENCH="yes"
- php: 7.0
env: TRANSPORT=jackrabbit SYMFONY_VERSION="2.8" PHPBENCH="yes"
- php: 5.3
# composer fails to find a solution for --prefer-lowest, even though i think there should exist one
env: TRANSPORT=jackrabbit
dist: precise
- php: 7.2
env: TRANSPORT=doctrine_dbal DEPENDENCIES="symfony/lts:^2"
- php: 7.2
env: TRANSPORT=jackrabbit DEPENDENCIES="symfony/lts:^2"
- php: 7.2
env: TRANSPORT=doctrine_dbal DEPENDENCIES="symfony/lts:^3" PHPBENCH="yes"
- php: 7.2
env: TRANSPORT=jackrabbit DEPENDENCIES="symfony/lts:^3" PHPBENCH="yes"
- php: 7.2
env: TRANSPORT=doctrine_dbal STABILITY="dev"
- php: 7.2
env: TRANSPORT=jackrabbit STABILITY="dev"
- php: hhvm
dist: trusty

before_script:
- composer self-update || true
before_install:
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
- if [ "$SYMFONY_VERSION" != "" ]; then composer require --no-update symfony/symfony=$SYMFONY_VERSION; fi;
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
- if ! [ -v "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;
- if [ "$PHPBENCH" = "yes" ]; then composer require --no-update phpbench/phpbench=~0.11; fi;

install:
# this also does the composer update
- ./tests/travis_${TRANSPORT}.sh

script:
- composer validate --strict --no-check-lock
- vendor/bin/phpunit -c tests/phpunit_${TRANSPORT}.xml.dist
- if [ "$PHPBENCH" = "yes" ]; then php vendor/bin/phpbench run --report=all; fi;


notifications:
irc: "irc.freenode.org#symfony-cmf"
email: "symfony-cmf-devs@googlegroups.com"
16 changes: 8 additions & 8 deletions composer.json
Expand Up @@ -13,26 +13,26 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^5.3.9|~7.0",
"php": "^5.3.9 || ^7.0",
"doctrine/common": "^2.4",
"doctrine/annotations": "^1.2",
"doctrine/data-fixtures": "^1.0",
"phpcr/phpcr": "^2.1.1",
"phpcr/phpcr-implementation": "^2.1.0",
"phpcr/phpcr-implementation": "^2.1",
"phpcr/phpcr-utils": "^1.2.8",
"doctrine/instantiator": "^1.0.1",
"symfony/console": "^2.3|^3.0"
},
"require-dev": {
"symfony/yaml": "^2.3|^3.0",
"symfony/phpunit-bridge": "^2.7|^3.0",
"liip/rmt": "~1.2",
"phpunit/phpunit": "^4.8|5.*"
"symfony/yaml": "^2.3 || ^3.0",
"symfony/phpunit-bridge": "^2.7 || ^3.0",
"liip/rmt": "^1.2",
"phpunit/phpunit": "^4.8 || ^5.0"
},
"suggest": {
"symfony/yaml": "^2.3|^3.0",
"jackalope/jackalope-doctrine-dbal": "^1.3.0",
"jackalope/jackalope-jackrabbit": "^1.3.0"
"jackalope/jackalope-doctrine-dbal": "^1.3",
"jackalope/jackalope-jackrabbit": "^1.3"
},
"conflict": {
"jackalope/jackalope-doctrine-dbal": "<1.1.5"
Expand Down
12 changes: 6 additions & 6 deletions lib/Doctrine/ODM/PHPCR/Id/IdException.php
Expand Up @@ -14,7 +14,7 @@ public static function noIdentificationParameters($document, $parent, $nodename)
'may not be empty in document of class "%s"',
$parent,
$nodename,
ClassUtils::getClass($document)
$document ? ClassUtils::getClass($document) : 'null'
);

return new self($message);
Expand All @@ -25,7 +25,7 @@ public static function noIdNoParent($document, $parent)
$message = sprintf(
'Property "%s" mapped as ParentDocument may not be empty in document of class "%s"',
$parent,
ClassUtils::getClass($document)
$document ? ClassUtils::getClass($document) : 'null'
);

return new self($message);
Expand All @@ -36,7 +36,7 @@ public static function noIdNoName($document, $fieldName)
$message = sprintf(
'NodeName property "%s" may not be empty in document of class "%s"',
$fieldName,
ClassUtils::getClass($document)
$document ? ClassUtils::getClass($document) : 'null'
);

return new self($message);
Expand All @@ -49,7 +49,7 @@ public static function parentIdCouldNotBeDetermined($document, $parent, $parentO
'ParentDocument property "%s" of document of class "%s" contains an ' .
'object for which no ID could be found',
$parent,
ClassUtils::getClass($document),
$document ? ClassUtils::getClass($document) : 'null',
$parentType
);

Expand All @@ -61,7 +61,7 @@ public static function illegalName($document, $fieldName, $nodeName)
$message = sprintf(
'NodeName property "%s" of document "%s" contains the illegal PHPCR value "%s".',
$fieldName,
ClassUtils::getClass($document),
$document ? ClassUtils::getClass($document) : 'null',
$nodeName
);

Expand All @@ -78,7 +78,7 @@ public static function conflictingChildName(
$message = sprintf(
'%s discovered as new child of %s in field "%s" has a node name ' .
'mismatch. The mapping says "%s" but the child was assigned "%s".',
ClassUtils::getClass($childDocument),
$childDocument ? ClassUtils::getClass($childDocument) : 'null',
$parentId,
$parentFieldName,
$fieldNodeName,
Expand Down
Expand Up @@ -2,9 +2,7 @@

namespace Doctrine\Tests\ODM\PHPCR\Functional;

use Doctrine\ODM\PHPCR\Id\RepositoryIdInterface;
use Doctrine\ODM\PHPCR\DocumentRepository;
use Doctrine\ODM\PHPCR\Exception\InvalidArgumentException;
use Doctrine\Tests\ODM\PHPCR\PHPCRFunctionalTestCase;
use PHPCR\PropertyType;
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;

Expand All @@ -13,7 +11,7 @@
*
* @group functional
*/
class FindTypeValidationTest extends \Doctrine\Tests\ODM\PHPCR\PHPCRFunctionalTestCase
class FindTypeValidationTest extends PHPCRFunctionalTestCase
{
/**
* @var \Doctrine\ODM\PHPCR\DocumentManager
Expand Down Expand Up @@ -114,7 +112,7 @@ public function testNotInstanceOf()
{
$user = $this->dm->find('Doctrine\Tests\ODM\PHPCR\Functional\TypeTeamUser', '/functional/user');

$this->assertTrue(null === $user, get_class($user));
$this->assertTrue(null === $user, is_object($user) ? get_class($user) : $user);
}

/**
Expand All @@ -126,7 +124,7 @@ public function testCacheNotInstanceOf()
$this->assertInstanceOf($this->type, $user);

$user = $this->dm->find('Doctrine\Tests\ODM\PHPCR\Functional\TypeTeamUser', '/functional/user');
$this->assertTrue(null === $user, get_class($user));
$this->assertTrue(null === $user, is_object($user) ? get_class($user) : $user);
}

/**
Expand Down
Expand Up @@ -135,8 +135,7 @@ public function testRestoreVersion()
$this->dm->flush();

$versions = $this->dm->getAllLinearVersions($user);
each($versions);
list($dummy, $versionInfo) = each($versions);
$versionInfo = next($versions);
$versionName = $versionInfo['name'];
$versionDocument = $this->dm->findVersionByName($this->typeVersion, '/functional/versionTestObj', $versionName);
$this->dm->restoreVersion($versionDocument);
Expand Down
6 changes: 3 additions & 3 deletions tests/Doctrine/Tests/ODM/PHPCR/Id/ParentIdGeneratorTest.php
Expand Up @@ -8,7 +8,7 @@
class ParentIdGeneratorTest extends \PHPUnit_Framework_TestCase
{
/**
* @covers Doctrine\ODM\PHPCR\Id\ParentIdGenerator::generate
* @covers \Doctrine\ODM\PHPCR\Id\ParentIdGenerator::generate
*/
public function testGenerate()
{
Expand All @@ -34,7 +34,7 @@ public function testGenerate()
}

/**
* @covers Doctrine\ODM\PHPCR\Id\ParentIdGenerator::generate
* @covers \Doctrine\ODM\PHPCR\Id\ParentIdGenerator::generate
*/
public function testGenerateNoParent()
{
Expand All @@ -48,7 +48,7 @@ public function testGenerateNoParent()
}

/**
* @covers Doctrine\ODM\PHPCR\Id\ParentIdGenerator::generate
* @covers \Doctrine\ODM\PHPCR\Id\ParentIdGenerator::generate
*/
public function testGenerateNoName()
{
Expand Down
Expand Up @@ -60,6 +60,11 @@ public function testCommand()
->with('Document\MyClass', array('en'), array(), 'none')
->will($this->returnValue(false))
;
$this->converter
->expects($this->any())
->method('getLastNotices')
->will($this->returnValue(array()))
;

$this->mockSession
->expects($this->once())
Expand Down

0 comments on commit ec06ac0

Please sign in to comment.