Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
Improved Travis setup
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed Jan 3, 2016
1 parent 0f3d000 commit a8a8e31
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
25 changes: 12 additions & 13 deletions .travis.yml
Expand Up @@ -12,34 +12,33 @@ sudo: false

cache:
directories:
- $HOME/.composer/cache
- $HOME/.composer/cache/files

env:
- SYMFONY_VERSION=2.7.* SYMFONY_DEPRECATIONS_HELPER=weak
global: SYMFONY_DEPRECATIONS_HELPER=533

matrix:
include:
- php: 5.6
env: DEPS=dev
- php: 5.3
env: SYMFONY_VERSION="^2.3.4" COMPOSER_FLAGS="--prefer-lowest"
- php: 5.6
env: SYMFONY_VERSION=2.3.* SYMFONY_DEPRECATIONS_HELPER=weak
- php: 5.6
env: SYMFONY_VERSION=2.8.*
env: SYMFONY_VERSION=2.3.*
- php: 5.6
env: SYMFONY_VERSION=3.0.*
allow_failures:
- env: SYMFONY_VERSION=2.8.*
- env: SYMFONY_VERSION=3.0.*
env: SYMFONY_VERSION=2.7.*
fast_finish: 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 [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
- phpenv config-rm xdebug.ini || true
- composer self-update
- composer require symfony/symfony:${SYMFONY_VERSION} --no-update
- if [ "$DEPS" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi
- if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION} --no-update; fi

install: composer update $COMPOSER_FLAGS --prefer-dist
install: composer update --prefer-dist $COMPOSER_FLAGS

script: phpunit --coverage-text
script: phpunit

notifications:
irc: "irc.freenode.org#symfony-cmf"
Expand Down
2 changes: 1 addition & 1 deletion Extension/ContentExtension.php
Expand Up @@ -67,7 +67,7 @@ public function buildOptions(array $options)
$options['uri'] = $this->contentRouter->generate(
$options['content'],
isset($options['routeParameters']) ? $options['routeParameters'] : array(),
isset($options['routeAbsolute']) ? $options['routeAbsolute'] : false
(isset($options['routeAbsolute']) && $options['routeAbsolute']) ? UrlGeneratorInterface::ABSOLUTE_URL : UrlGeneratorInterface::ABSOLUTE_PATH
);
}

Expand Down
5 changes: 3 additions & 2 deletions Tests/Unit/Extension/ContentExtensionTest.php
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Cmf\Bundle\MenuBundle\Tests\Unit\Extension;

use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Cmf\Bundle\MenuBundle\Extension\ContentExtension;

class ContentExtensionTest extends \PHPUnit_Framework_TestCase
Expand Down Expand Up @@ -76,7 +77,7 @@ public function testContentLinkType($typeSet)

$this->generator->expects($this->once())
->method('generate')
->with('configured_content', array('test' => 'foo'), true)
->with('configured_content', array('test' => 'foo'), UrlGeneratorInterface::ABSOLUTE_URL)
->willReturn('/generated_uri');

$this->assertEquals(
Expand All @@ -103,7 +104,7 @@ public function testOptionsAsRemovedWhenLinkTypeIsElse()

$this->generator->expects($this->once())
->method('generate')
->with('configured_content', array(), false)
->with('configured_content', array(), UrlGeneratorInterface::ABSOLUTE_PATH)
->willReturn('/generated_uri');

$this->assertEquals(
Expand Down
4 changes: 1 addition & 3 deletions composer.json
Expand Up @@ -11,8 +11,6 @@
"homepage": "https://github.com/symfony-cmf/MenuBundle/contributors"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^5.3.9|^7.0",
"symfony/framework-bundle": "^2.3",
Expand All @@ -25,7 +23,7 @@
"require-dev": {
"symfony/monolog-bundle": "^2.3",
"symfony-cmf/routing-bundle": "^1.2.0-RC3",
"symfony-cmf/testing": "^1.3",
"symfony-cmf/testing": "^1.3@dev",
"symfony-cmf/tree-browser-bundle": "^1.0.0-RC1",
"doctrine/phpcr-odm": "^1.3",
"twig/twig": "^1.12.1",
Expand Down

0 comments on commit a8a8e31

Please sign in to comment.