Skip to content

[bundle] Fix extensions priority ordering. Must be from high to low. #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ install:
- rm $HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini;
- echo "memory_limit=2048M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer require symfony/symfony:${SYMFONY_VERSION} --no-update
- composer update
- composer install --ignore-platform-reqs # ext-amqp is not installed
- if [ "$FUNCTIONAL_TESTS" = true ]; then docker --version; fi
- if [ "$FUNCTIONAL_TESTS" = true ]; then docker-compose --version; fi
- if [ "$FUNCTIONAL_TESTS" = true ]; then bin/dev -b; fi
Expand Down
2 changes: 1 addition & 1 deletion pkg/amqp-ext/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cache:

install:
- composer self-update
- composer install --prefer-source
- composer install --prefer-source --ignore-platform-reqs # ext-amqp is not installed

script:
- vendor/bin/phpunit --exclude-group=functional
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function process(ContainerBuilder $container)
}
}

ksort($groupByPriority);
krsort($groupByPriority, SORT_NUMERIC);

$flatExtensions = [];
foreach ($groupByPriority as $extension) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ public function testShouldOrderExtensionsByPriority()

$orderedExtensions = $extensions->getArgument(0);

$this->assertEquals(new Reference('bar_extension'), $orderedExtensions[0]);
$this->assertEquals(new Reference('foo_extension'), $orderedExtensions[0]);
$this->assertEquals(new Reference('baz_extension'), $orderedExtensions[1]);
$this->assertEquals(new Reference('foo_extension'), $orderedExtensions[2]);
$this->assertEquals(new Reference('bar_extension'), $orderedExtensions[2]);
}

public function testShouldAssumePriorityZeroIfPriorityIsNotSet()
Expand Down Expand Up @@ -103,8 +103,8 @@ public function testShouldAssumePriorityZeroIfPriorityIsNotSet()

$orderedExtensions = $extensions->getArgument(0);

$this->assertEquals(new Reference('baz_extension'), $orderedExtensions[0]);
$this->assertEquals(new Reference('bar_extension'), $orderedExtensions[0]);
$this->assertEquals(new Reference('foo_extension'), $orderedExtensions[1]);
$this->assertEquals(new Reference('bar_extension'), $orderedExtensions[2]);
$this->assertEquals(new Reference('baz_extension'), $orderedExtensions[2]);
}
}