Skip to content

Commit

Permalink
minor #164 Phpunit update (sstok)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.0-dev branch.

Discussion
----------

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | 
| License       | MIT
| Doc PR        | 

Commits
-------

de7f325 Update phpunit to 6.2
0ceda7f Disable 1.x branch on Travis
  • Loading branch information
sstok authored Aug 6, 2017
2 parents bd38e66 + 0ceda7f commit dcd416a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ sudo: false
branches:
only:
- master
- 1.x

matrix:
include:
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
],
"require": {
"php": "^7.1",
"symfony/options-resolver": "^3.2.1",
"symfony/property-access": "^3.2.1",
"symfony/intl": "^3.2.1",
"symfony/options-resolver": "^3.3.6",
"symfony/property-access": "^3.3.6",
"symfony/intl": "^3.3.6",
"psr/container": "^1.0.0"
},
"require-dev": {
"moneyphp/money": "^3.0.0",
"phpunit/phpunit": "^5.7.5",
"symfony/phpunit-bridge": "^3.2.1",
"phpunit/phpunit": "^6.2.4.",
"symfony/phpunit-bridge": "^3.3.6",
"symfony/var-dumper": "^3.2.1"
},
"suggest": {
Expand All @@ -38,7 +38,7 @@
"psr-4": {
"Rollerworks\\Component\\Search\\": "src/"
},
"exclude-from-classmap": ["Tests/", "test/"]
"exclude-from-classmap": ["test/"]
},
"autoload-dev": {
"psr-4": {
Expand Down
4 changes: 1 addition & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.7/phpunit.xsd"
backupGlobals="false"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.2/phpunit.xsd"
colors="true"
bootstrap="vendor/autoload.php"
beStrictAboutTestsThatDoNotTestAnything="false"
Expand Down Expand Up @@ -30,7 +29,6 @@
<directory>./vendor/</directory>
<directory>./tests/</directory>
<directory>./doc/</directory>
<directory>./bin/</directory>
</exclude>
</whitelist>
</filter>
Expand Down
12 changes: 6 additions & 6 deletions src/Test/FieldTransformationAssertion.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace Rollerworks\Component\Search\Test;

use PHPUnit_Framework_Assert;
use PHPUnit_Framework_AssertionFailedError as AssertionFailedError;
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\AssertionFailedError;
use Rollerworks\Component\Search\Exception\TransformationFailedException;
use Rollerworks\Component\Search\Field\FieldConfig;

Expand Down Expand Up @@ -66,8 +66,8 @@ public function successfullyTransformsTo($model): self
throw new AssertionFailedError('Norm->model: '.$e->getMessage(), $e->getCode(), $e);
}

PHPUnit_Framework_Assert::assertEquals($model, $viewValue, 'View->model value does not equal');
PHPUnit_Framework_Assert::assertEquals($model, $normValue, 'Norm->model value does not equal');
Assert::assertEquals($model, $viewValue, 'View->model value does not equal');
Assert::assertEquals($model, $normValue, 'Norm->model value does not equal');

$this->transformed = true;
$this->model = $model;
Expand Down Expand Up @@ -120,8 +120,8 @@ public function andReverseTransformsTo($expectedView = null, $expectedNorm = nul
throw new AssertionFailedError('Model->norm: '.$e->getMessage(), $e->getCode(), $e);
}

PHPUnit_Framework_Assert::assertEquals($expectedView, $viewValue, 'View value does not equal');
PHPUnit_Framework_Assert::assertEquals($expectedNorm ?? $expectedView, $normValue, 'Norm value does not equal');
Assert::assertEquals($expectedView, $viewValue, 'View value does not equal');
Assert::assertEquals($expectedNorm ?? $expectedView, $normValue, 'Norm value does not equal');
}

private function viewToModel($value)
Expand Down
3 changes: 2 additions & 1 deletion tests/Extension/Core/ChoiceList/LazyChoiceListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@

namespace Rollerworks\Component\Search\Tests\Extension\Core\ChoiceList;

use PHPUnit\Framework\TestCase;
use Rollerworks\Component\Search\Extension\Core\ChoiceList\ChoiceList;
use Rollerworks\Component\Search\Extension\Core\ChoiceList\LazyChoiceList;
use Rollerworks\Component\Search\Extension\Core\ChoiceList\Loader\ChoiceLoader;

/**
* @author Bernhard Schussek <[email protected]>
*/
class LazyChoiceListTest extends \PHPUnit_Framework_TestCase
class LazyChoiceListTest extends TestCase
{
/**
* @var LazyChoiceList
Expand Down
4 changes: 3 additions & 1 deletion tests/assertDateTimeEqualsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@

namespace Rollerworks\Component\Search\Tests;

use PHPUnit\Framework\Assert;

trait assertDateTimeEqualsTrait
{
public static function assertDateTimeEquals(\DateTimeInterface $expected, \DateTimeInterface $actual)
{
\PHPUnit_Framework_Assert::assertEquals(
Assert::assertEquals(
$expected->format('U'),
$actual->format('U'),
$expected->format('c').' <=> '.$actual->format('c')
Expand Down

0 comments on commit dcd416a

Please sign in to comment.