Skip to content

Test enhancement #18

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion .styleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ enabled:
- strict

disabled:
- empty_return
- phpdoc_annotation_without_dot # This is still buggy: https://github.com/symfony/symfony/pull/19198
19 changes: 10 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
language: php

sudo: false

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

matrix:
include:
- php: 5.3
- php: 5.4
- php: 5.5
- php: 5.6
- php: hhvm
- php: nightly
- php: 7.0
- php: 7.1
env: COVERAGE=yes
- php: 7.0
- php: 7.1
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'
- php: 7.2
env: COVERAGE=yes
- php: 7.2
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'
- php: 7.3
env: COVERAGE=yes
- php: 7.3
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'
allow_failures:
- php: hhvm
- php: nightly
fast_finish: true

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
}
],
"require": {
"php": "^5.3.9|^7.0",
"php": "^7.0",
"puli/repository": "^1.0-beta11@dev,<1.1",
"puli/discovery": "^1.0.0-beta10@dev",
"webmozart/glob": "^4.0",
"webmozart/path-util": "^2.3"
},
"require-dev": {
"phpunit/phpunit": "^4.6",
"sebastian/version": "^1.0.1"
"phpunit/phpunit": "^6.5",
"sebastian/version": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 1 addition & 0 deletions src/DiscoveryUrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public function generateUrl($repositoryPath, $currentUrl = null)
/** @var ResourceBinding $binding */
if (Glob::match($repositoryPath, $binding->getQuery())) {
$matchedBinding = $binding;

break;
}
}
Expand Down
10 changes: 5 additions & 5 deletions tests/DiscoveryUrlGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

namespace Puli\UrlGenerator\Tests;

use PHPUnit_Framework_MockObject_MockObject;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;
use Puli\Discovery\Api\Discovery;
use Puli\Discovery\Api\Type\BindingParameter;
use Puli\Discovery\Api\Type\BindingType;
Expand All @@ -27,12 +26,12 @@
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class DiscoveryUrlGeneratorTest extends PHPUnit_Framework_TestCase
class DiscoveryUrlGeneratorTest extends TestCase
{
const RESOURCE_BINDING = 'Puli\Repository\Discovery\ResourceBinding';

/**
* @var PHPUnit_Framework_MockObject_MockObject|Discovery
* @var PHPUnit\Framework\MockObject\MockObject|Discovery
*/
private $discovery;

Expand All @@ -53,7 +52,8 @@ class DiscoveryUrlGeneratorTest extends PHPUnit_Framework_TestCase

protected function setUp()
{
$this->discovery = $this->getMock('Puli\Discovery\Api\Discovery');
$this->discovery = $this->getMockBuilder('Puli\Discovery\Api\Discovery');
$this->discovery = $this->discovery->getMock();
$this->generator = new DiscoveryUrlGenerator($this->discovery, array(
'localhost' => '/%s',
'example.com' => 'https://example.com/%s',
Expand Down