From a390cac5c3fdb05feef0fd4e7daa897f221f9032 Mon Sep 17 00:00:00 2001 From: Nick Le Mouton Date: Tue, 20 Mar 2018 00:54:43 +1300 Subject: [PATCH] Update for PHPUnit 6.x/DBUnit (#19) Refactor and clean up for PHPUnit 6.x and DBUnit 3.x. Fix risky tests Move files into a dir structure based on php-pds/skeleton Add phpunit.xml and travis ci config Remove Mockery for now until it supports PHPUnit 6.x --- .travis.yml | 24 + .../MockObject/Stub/ReturnMapping/Entry.php | 31 - PHPUnit/Extensions/Mockery/TestCase.php | 69 -- Tests/Extensions/Assert/MoreTest.php | 85 -- .../Constraint/ArrayEqualsNoOrderTest.php | 24 - .../Constraint/ArrayHasKeyValuePairTest.php | 117 --- Tests/Extensions/Constraint/HasItemsTest.php | 103 --- Tests/Extensions/Mockery/TestCaseTest.php | 94 -- composer.json | 6 +- composer.lock | 808 +++++++++--------- phpunit.xml | 23 + .../Experimental/FileSystemTestSuite.php | 0 .../PHPUnit}/Experimental/PHPUI/Command.php | 0 .../Experimental/PHPUI/ResultPrinter.php | 0 .../PHPUnit}/Extensions/Assert/More.php | 25 +- .../Constraint/ArrayEqualsNoOrder.php | 10 +- .../Constraint/ArrayHasKeyValuePair.php | 7 +- .../Extensions/Constraint/EqualsClosure.php | 7 +- .../Extensions/Constraint/HasItems.php | 5 +- .../StringMatchIgnoreWhitespace.php | 5 +- .../Database/DataSet/EtsyArrayDataSet.php | 17 +- .../Extensions/Helper/AccessibleObject.php | 5 +- .../MockObject/Stub/ReturnMapping.php | 17 +- .../MockObject/Stub/ReturnMapping/Builder.php | 20 +- .../MockObject/Stub/ReturnMapping/Entry.php | 36 + .../Stub/ReturnMapping/EntryBuilder.php | 20 +- .../MultipleDatabase/DatabaseConfig.php | 3 +- .../DatabaseConfig/Builder.php | 40 +- .../Extensions/MultipleDatabase/TestCase.php | 22 +- .../Extensions/MultipleDatabase/Tester.php | 7 +- tests/Assert/MoreTest.php | 82 ++ tests/Constraint/ArrayEqualsNoOrderTest.php | 22 + tests/Constraint/ArrayHasKeyValuePairTest.php | 119 +++ .../Constraint/EqualsClosureTest.php | 23 +- tests/Constraint/HasItemsTest.php | 109 +++ .../StringMatchIgnoreWhitespaceTest.php | 44 +- .../Database/DataSet/EtsyArrayDataSetTest.php | 45 +- .../Helper/AccessibleObjectTest.php | 14 +- .../MockObject/Stub/ReturnMappingTest.php | 35 +- .../DatabaseConfig/BuilderTest.php | 39 +- tests/MultipleDatabase/DatabaseConfigTest.php | 55 ++ .../MultipleDatabase/TestCaseTest.php | 55 +- .../MultipleDatabase/TesterTest.php | 28 +- 43 files changed, 1187 insertions(+), 1113 deletions(-) create mode 100644 .travis.yml delete mode 100644 PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Entry.php delete mode 100644 PHPUnit/Extensions/Mockery/TestCase.php delete mode 100644 Tests/Extensions/Assert/MoreTest.php delete mode 100644 Tests/Extensions/Constraint/ArrayEqualsNoOrderTest.php delete mode 100644 Tests/Extensions/Constraint/ArrayHasKeyValuePairTest.php delete mode 100644 Tests/Extensions/Constraint/HasItemsTest.php delete mode 100644 Tests/Extensions/Mockery/TestCaseTest.php create mode 100644 phpunit.xml rename {PHPUnit => src/PHPUnit}/Experimental/FileSystemTestSuite.php (100%) rename {PHPUnit => src/PHPUnit}/Experimental/PHPUI/Command.php (100%) rename {PHPUnit => src/PHPUnit}/Experimental/PHPUI/ResultPrinter.php (100%) rename {PHPUnit => src/PHPUnit}/Extensions/Assert/More.php (72%) rename {PHPUnit => src/PHPUnit}/Extensions/Constraint/ArrayEqualsNoOrder.php (60%) rename {PHPUnit => src/PHPUnit}/Extensions/Constraint/ArrayHasKeyValuePair.php (91%) rename {PHPUnit => src/PHPUnit}/Extensions/Constraint/EqualsClosure.php (82%) rename {PHPUnit => src/PHPUnit}/Extensions/Constraint/HasItems.php (85%) rename {PHPUnit => src/PHPUnit}/Extensions/Constraint/StringMatchIgnoreWhitespace.php (87%) rename {PHPUnit => src/PHPUnit}/Extensions/Database/DataSet/EtsyArrayDataSet.php (73%) rename {PHPUnit => src/PHPUnit}/Extensions/Helper/AccessibleObject.php (93%) rename {PHPUnit => src/PHPUnit}/Extensions/MockObject/Stub/ReturnMapping.php (76%) rename {PHPUnit => src/PHPUnit}/Extensions/MockObject/Stub/ReturnMapping/Builder.php (64%) create mode 100644 src/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Entry.php rename {PHPUnit => src/PHPUnit}/Extensions/MockObject/Stub/ReturnMapping/EntryBuilder.php (69%) rename {PHPUnit => src/PHPUnit}/Extensions/MultipleDatabase/DatabaseConfig.php (94%) rename {PHPUnit => src/PHPUnit}/Extensions/MultipleDatabase/DatabaseConfig/Builder.php (64%) rename {PHPUnit => src/PHPUnit}/Extensions/MultipleDatabase/TestCase.php (72%) rename {PHPUnit => src/PHPUnit}/Extensions/MultipleDatabase/Tester.php (80%) create mode 100644 tests/Assert/MoreTest.php create mode 100644 tests/Constraint/ArrayEqualsNoOrderTest.php create mode 100644 tests/Constraint/ArrayHasKeyValuePairTest.php rename {Tests/Extensions => tests}/Constraint/EqualsClosureTest.php (81%) create mode 100644 tests/Constraint/HasItemsTest.php rename {Tests/Extensions => tests}/Constraint/StringMatchIgnoreWhitespaceTest.php (52%) rename {Tests/Extensions => tests}/Database/DataSet/EtsyArrayDataSetTest.php (78%) rename {Tests/Extensions => tests}/Helper/AccessibleObjectTest.php (89%) rename {Tests/Extensions => tests}/MockObject/Stub/ReturnMappingTest.php (75%) rename {Tests/Extensions => tests}/MultipleDatabase/DatabaseConfig/BuilderTest.php (78%) create mode 100644 tests/MultipleDatabase/DatabaseConfigTest.php rename {Tests/Extensions => tests}/MultipleDatabase/TestCaseTest.php (65%) rename {Tests/Extensions => tests}/MultipleDatabase/TesterTest.php (56%) diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..79d0f83 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,24 @@ +language: php + +php: + - 7.1 + - 7.2 + - nightly + +env: + global: + - DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest" + +sudo: false + +before_install: + - composer clear-cache + +install: + - travis_retry composer update $DEFAULT_COMPOSER_FLAGS + +script: + - ./vendor/bin/phpunit + +notifications: + email: false diff --git a/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Entry.php b/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Entry.php deleted file mode 100644 index 3dff0b3..0000000 --- a/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Entry.php +++ /dev/null @@ -1,31 +0,0 @@ -parameters = $parameters; - $this->return = $return; - } - - public function matches(PHPUnit_Framework_MockObject_Invocation $invocation) { - try { - $this->parameters->matches($invocation); - return true; - } catch (PHPUnit_Framework_ExpectationFailedException $ignore) { - return false; - } - } - - public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation) { - if ($this->return instanceof PHPUnit_Framework_MockObject_Stub) { - return $this->return->invoke($invocation); - } - return $this->return; - } -} - diff --git a/PHPUnit/Extensions/Mockery/TestCase.php b/PHPUnit/Extensions/Mockery/TestCase.php deleted file mode 100644 index 779d5f8..0000000 --- a/PHPUnit/Extensions/Mockery/TestCase.php +++ /dev/null @@ -1,69 +0,0 @@ -getProperties(); - foreach ($properties as $property) { - $doc_comment = $property->getDocComment(); - if (preg_match(self::REGEX_MOCK, $doc_comment, $matches)) { - $annotations = $this->parseAnnotations($doc_comment); - if (isset($annotations['mockery'])) { - $property_name = $property->getName(); - $this->{$property_name} = - $this->getMockery($annotations['mockery'][0]); - } - } - } - } - - protected function verifyMockObjects() { - $container = Mockery::getContainer(); - if (isset($container)) { - $reflected_container = new ReflectionClass($container); - $reflected_mocks = $reflected_container->getProperty('_mocks'); - $reflected_mocks->setAccessible(true); - $mocks = $reflected_mocks->getValue($container); - foreach ($mocks as $mock) { - $reflected_mock = new ReflectionClass($mock); - $reflected_expectations = - $reflected_mock->getProperty('_mockery_expectations'); - $reflected_expectations->setAccessible(true); - $expectations = $reflected_expectations->getValue($mock); - foreach ($expectations as $director) { - $this->addToAssertionCount(count($director->getExpectations())); - } - } - Mockery::close(); - } - - - parent::verifyMockObjects(); - } - - protected function getMockery() { - $args = func_get_args(); - return call_user_func_array(array('Mockery', 'mock'), $args); - } - - // TODO: Use PHPUnit_Util_Test::parseAnnotations() instead - private function parseAnnotations($docblock) { - $annotations = array(); - // Strip away the docblock header and footer to ease parsing of one line annotations - $docblock = substr($docblock, 3, -2); - - if (preg_match_all('/@(?P[A-Za-z_-]+)(?:[ \t]+(?P.*?))?[ \t]*\r?$/m', $docblock, $matches)) { - $numMatches = count($matches[0]); - - for ($i = 0; $i < $numMatches; ++$i) { - $annotations[$matches['name'][$i]][] = $matches['value'][$i]; - } - } - - return $annotations; - } -} diff --git a/Tests/Extensions/Assert/MoreTest.php b/Tests/Extensions/Assert/MoreTest.php deleted file mode 100644 index e93a986..0000000 --- a/Tests/Extensions/Assert/MoreTest.php +++ /dev/null @@ -1,85 +0,0 @@ - 'value')); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testAssertHasItems_fails() { - PHPUnit_Extensions_Assert_More::assertHasItems( - array(4), - array(1, 2, 3)); - } - - public function testAssertArrayEqualsNoOrder_passes() { - PHPUnit_Extensions_Assert_More::assertArrayEqualsNoOrder( - array(1, 2, 3), - array(3, 1, 2)); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testAssertArrayEqualsNoOrder_sameSize() { - PHPUnit_Extensions_Assert_More::assertArrayEqualsNoOrder( - array(1, 2, 3), - array(4, 5, 6)); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testAssertArrayEqualsNoOrder_duplicates() { - PHPUnit_Extensions_Assert_More::assertArrayEqualsNoOrder( - array(1, 2, 3), - array(1, 1, 2, 3)); - } - - public function testAssertStringMatchIgnoreWhitespace_passes() { - PHPUnit_Extensions_Assert_More::assertStringMatchIgnoreWhitespace( - "spaces do not matter", - "spaces\ndo\tnot matter "); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testAssertStringMatchIgnoreWhitespace_fails() { - PHPUnit_Extensions_Assert_More::assertStringMatchIgnoreWhitespace( - "spaces do not matter", - "but the not whitespace characters do!"); - } -} - diff --git a/Tests/Extensions/Constraint/ArrayEqualsNoOrderTest.php b/Tests/Extensions/Constraint/ArrayEqualsNoOrderTest.php deleted file mode 100644 index 5b0c428..0000000 --- a/Tests/Extensions/Constraint/ArrayEqualsNoOrderTest.php +++ /dev/null @@ -1,24 +0,0 @@ - 1 1 => 2 2 => 3 ) and count matches 3', - $constraint->toString()); - } -} - diff --git a/Tests/Extensions/Constraint/ArrayHasKeyValuePairTest.php b/Tests/Extensions/Constraint/ArrayHasKeyValuePairTest.php deleted file mode 100644 index a555bec..0000000 --- a/Tests/Extensions/Constraint/ArrayHasKeyValuePairTest.php +++ /dev/null @@ -1,117 +0,0 @@ -evaluate(null); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testEvaluate_nullExpected() { - $constraint = new PHPUnit_Extensions_Constraint_ArrayHasKeyValuePair(null, null); - $constraint->evaluate(array(1, 2, 3)); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testEvaluate_nullActual() { - $constraint = - new PHPUnit_Extensions_Constraint_ArrayHasKeyValuePair('key', 'value'); - $constraint->evaluate(null); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testEvaluate_empty() { - $constraint = new PHPUnit_Extensions_Constraint_ArrayHasKeyValuePair('key', 'value'); - $constraint->evaluate(array()); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testEvaluate_emptyExpected() { - $constraint = - new PHPUnit_Extensions_Constraint_ArrayHasKeyValuePair(null, array()); - $constraint->evaluate(array(1, 2, 3)); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testEvaluate_emptyActual() { - $constraint = - new PHPUnit_Extensions_Constraint_ArrayHasKeyValuePair('key', 'value'); - $constraint->evaluate(array()); - } - - public function testEvaluate_equal() { - $constraint = - new PHPUnit_Extensions_Constraint_ArrayHasKeyValuePair('key', 'value'); - $constraint->evaluate(array('key' => 'value')); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testEvaluate_keyMatchOnly() { - $constraint = - new PHPUnit_Extensions_Constraint_ArrayHasKeyValuePair('key', 'missing'); - $constraint->evaluate(array('key' => null)); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testEvaluate_valueMatchOnly() { - $constraint = - new PHPUnit_Extensions_Constraint_ArrayHasKeyValuePair('WRONG', 'value'); - $constraint->evaluate(array('NO MATCH' => 'value')); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testEvaluate_existButNotPaired() { - $constraint = - new PHPUnit_Extensions_Constraint_ArrayHasKeyValuePair('key', 'value'); - $constraint->evaluate(array('key' => 1, 'value')); - } - - public function testEvaluate_multiDimensional() { - $constraint = - new PHPUnit_Extensions_Constraint_ArrayHasKeyValuePair('key', array(1, 2, 3)); - $constraint->evaluate(array('key' => array(1, 2, 3))); - } - - public function testEvaluate_duplicateValue() { - $constraint = - new PHPUnit_Extensions_Constraint_ArrayHasKeyValuePair('key', 'value'); - $constraint->evaluate(array(1, 'value', 2, 'value', 'key' => 'value', 3)); - } - - public function testToString() { - $constraint = - new PHPUnit_Extensions_Constraint_ArrayHasKeyValuePair('KEY', 'VALUE'); - PHPUnit_Extensions_Assert_More::assertStringMatchIgnoreWhitespace( - "has the key 'KEY' with the value 'VALUE'", - $constraint->toString()); - } -} - diff --git a/Tests/Extensions/Constraint/HasItemsTest.php b/Tests/Extensions/Constraint/HasItemsTest.php deleted file mode 100644 index d3d15c3..0000000 --- a/Tests/Extensions/Constraint/HasItemsTest.php +++ /dev/null @@ -1,103 +0,0 @@ -evaluate(null); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testEvaluate_nullExpected() { - $constraint = new PHPUnit_Extensions_Constraint_HasItems(null); - $constraint->evaluate(array(1, 2, 3)); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testEvaluate_nullActual() { - $constraint = - new PHPUnit_Extensions_Constraint_HasItems(array(1, 2, 3)); - $constraint->evaluate(null); - } - - public function testEvaluate_empty() { - $constraint = new PHPUnit_Extensions_Constraint_HasItems(array()); - $constraint->evaluate(array()); - } - - public function testEvaluate_emptyExpected() { - $constraint = - new PHPUnit_Extensions_Constraint_HasItems(array()); - $constraint->evaluate(array(1, 2, 3)); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testEvaluate_emptyActual() { - $constraint = - new PHPUnit_Extensions_Constraint_HasItems(array(1, 2, 3)); - $constraint->evaluate(array()); - } - - public function testEvaluate_equal() { - $constraint = - new PHPUnit_Extensions_Constraint_HasItems(array(1, 2, 3)); - $constraint->evaluate(array(1, 2, 3)); - } - - public function testEvaluate_sameDifferentOrder() { - $constraint = - new PHPUnit_Extensions_Constraint_HasItems(array(1, 2, 3)); - $constraint->evaluate(array(3, 1, 2)); - } - - public function testEvaluate_duplicateExpected() { - $constraint = - new PHPUnit_Extensions_Constraint_HasItems(array(1, 1, 2, 2, 3, 3)); - $constraint->evaluate(array(1, 2, 3)); - } - - public function testEvaluate_duplicateActual() { - $constraint = - new PHPUnit_Extensions_Constraint_HasItems(array(1, 2, 3)); - $constraint->evaluate(array(1, 1, 2, 2, 3, 3)); - } - - public function testEvaluate_moreThanExpected() { - $constraint = - new PHPUnit_Extensions_Constraint_HasItems(array(1, 2, 3)); - $constraint->evaluate(array(1, 0, 2, 3)); - } - - /** - * @expectedException PHPUnit_Framework_AssertionFailedError - */ - public function testEvaluate_lessThanExpected() { - $constraint = new PHPUnit_Extensions_Constraint_HasItems(array(1, 0, 2, 3)); - $constraint->evaluate(array(1, 2, 3)); - } - - public function testToString() { - $constraint = new PHPUnit_Extensions_Constraint_HasItems(array(1, 2, 3)); - PHPUnit_Extensions_Assert_More::assertStringMatchIgnoreWhitespace( - 'has items Array ( 0 => 1 1 => 2 2 => 3 )', - $constraint->toString()); - } -} - diff --git a/Tests/Extensions/Mockery/TestCaseTest.php b/Tests/Extensions/Mockery/TestCaseTest.php deleted file mode 100644 index 4860a22..0000000 --- a/Tests/Extensions/Mockery/TestCaseTest.php +++ /dev/null @@ -1,94 +0,0 @@ -foo = $foo; - } - - function baz() { - $this->foo->foo(); - } -} - -class Tests_Extensions_Mockery_TestCaseTest -extends PHPUnit_Extensions_Mockery_TestCase { - - /** @mockery Tests_Extensions_Mockery_TestCase_Foo */ - protected $foo; - - /** @mockery Tests_Extensions_Mockery_TestCase_Bar */ - protected $bar; - - protected $baz; - - protected $old; - - protected function setUp() { - parent::setUp(); - $this->baz = $this->getMockery( - new Tests_Extensions_Mockery_TestCase_Baz($this->foo) - ); - $this->old = $this->getMockBuilder('Tests_Extensions_Mockery_TestCase_Baz') - ->disableOriginalConstructor() - ->getMock(); - } - - public function testFoo_notNull() { - $this->assertNotNull($this->foo); - } - - public function testFoo_canMockFunction() { - $this->foo->shouldReceive('foo')->andReturn(2)->atLeast(1); - $this->assertEquals(2, $this->foo->foo()); - } - - public function testBar_notNull() { - $this->assertNotNull($this->bar); - } - - public function testBar_canMockFunction() { - $this->bar->shouldReceive('bar')->never(); - } - - public function testBaz_notNull() { - $this->assertNotNull($this->baz); - } - - public function testBaz_partialCallsThrough() { - $this->foo->shouldReceive('foo')->once(); - $this->baz->baz(); - } - - public function testBaz_bypassFoo() { - $this->foo->shouldReceive('foo')->never(); - $this->baz->shouldReceive('baz')->once(); - $this->baz->baz(); - } - - public function testOld_notNull() { - $this->assertNotNull($this->old); - } - - public function testOld_canMockFunction() { - $this->old - ->expects($this->atLeastOnce()) - ->method('baz') - ->will($this->returnSelf()); - $this->assertEquals($this->old, $this->old->baz()); - } -} diff --git a/composer.json b/composer.json index 1407d92..25ca9dc 100644 --- a/composer.json +++ b/composer.json @@ -11,13 +11,13 @@ "license": "BSD-3-Clause", "require": { "php": "^7.1", - "phpunit/phpunit": "^5.7.5", - "phpunit/dbunit": "^2.0.2", + "phpunit/phpunit": "^6.0.0", + "phpunit/dbunit": "^3.0.0", "mockery/mockery": "^1.0.0" }, "autoload": { "classmap": [ - "PHPUnit/" + "src/" ] } } diff --git a/composer.lock b/composer.lock index df73486..6b7ac69 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "62d2046dd2f1fc49cb252f2f21f25307", - "content-hash": "5054c309dd0ecc79fc706787f1b2e573", + "content-hash": "d4577dd72337c530f727998d43ba2a6a", "packages": [ { "name": "doctrine/instantiator", @@ -19,13 +18,7 @@ "type": "zip", "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^7.1" @@ -65,7 +58,7 @@ "constructor", "instantiate" ], - "time": "2017-07-22 11:58:36" + "time": "2017-07-22T11:58:36+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -79,13 +72,7 @@ "type": "zip", "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/776503d3a8e85d4f9a1148614f95b7a608b046ad", "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^5.3|^7.0" @@ -119,7 +106,7 @@ "keywords": [ "test" ], - "time": "2016-01-20 08:20:44" + "time": "2016-01-20T08:20:44+00:00" }, { "name": "mockery/mockery", @@ -184,47 +171,44 @@ "test double", "testing" ], - "time": "2017-10-06 16:20:43" + "time": "2017-10-06T16:20:43+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.6.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "doctrine/collections": "1.*", - "phpunit/phpunit": "~4.1" + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.1" }, "type": "library", "autoload": { "psr-4": { "DeepCopy\\": "src/DeepCopy/" - } + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Create deep copies (clones) of your objects", - "homepage": "https://github.com/myclabs/DeepCopy", "keywords": [ "clone", "copy", @@ -232,27 +216,123 @@ "object", "object graph" ], - "time": "2017-04-12 18:52:22" + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "1.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" }, "require": { "php": ">=5.5" @@ -292,39 +372,39 @@ "reflection", "static analysis" ], - "time": "2015-12-27 11:43:31" + "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.2.2", + "version": "4.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" + "reference": "66465776cfc249844bde6d117abff1d22e06c2da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", - "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/66465776cfc249844bde6d117abff1d22e06c2da", + "reference": "66465776cfc249844bde6d117abff1d22e06c2da", + "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.3.0", + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ @@ -343,27 +423,21 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-08 06:39:58" + "time": "2017-11-27T17:38:31+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.3.0", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", - "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" }, "require": { "php": "^5.5 || ^7.0", @@ -396,43 +470,37 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-06-03 08:32:36" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.7.0", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "sebastian/comparator": "^1.1|^2.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -465,42 +533,33 @@ "spy", "stub" ], - "time": "2017-03-02 20:05:34" + "time": "2017-11-24T13:59:53+00:00" }, { "name": "phpunit/dbunit", - "version": "2.0.3", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/dbunit.git", - "reference": "5c35d74549c21ba55d0ea74ba89d191a51f8cf25" + "reference": "403350339b6aca748ee0067d027d85621992e21f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/5c35d74549c21ba55d0ea74ba89d191a51f8cf25", - "reference": "5c35d74549c21ba55d0ea74ba89d191a51f8cf25", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/403350339b6aca748ee0067d027d85621992e21f", + "reference": "403350339b6aca748ee0067d027d85621992e21f", + "shasum": "" }, "require": { "ext-pdo": "*", "ext-simplexml": "*", - "php": "^5.4 || ^7.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0", - "symfony/yaml": "^2.1 || ^3.0" + "php": "^7.0", + "phpunit/phpunit": "^6.0", + "symfony/yaml": "^3.0 || ^4.0" }, - "bin": [ - "dbunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -515,61 +574,55 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "DbUnit port for PHP/PHPUnit to support database interaction testing.", + "description": "PHPUnit extension for database interaction testing", "homepage": "https://github.com/sebastianbergmann/dbunit/", "keywords": [ "database", "testing", "xunit" ], - "time": "2016-12-02 14:39:14" + "time": "2017-11-18T17:40:34+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "4.0.8", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1", + "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1", + "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^6.0" }, "suggest": { - "ext-xdebug": "^2.5.1" + "ext-xdebug": "^2.5.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "5.3.x-dev" } }, "autoload": { @@ -584,7 +637,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -595,27 +648,21 @@ "testing", "xunit" ], - "time": "2017-04-02 07:44:40" + "time": "2017-12-06T09:29:45+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "shasum": "" }, "require": { "php": ">=5.3.3" @@ -648,7 +695,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03 07:40:28" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -662,13 +709,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.3.3" @@ -695,7 +736,7 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", @@ -709,13 +750,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0" @@ -750,27 +785,21 @@ "keywords": [ "timer" ], - "time": "2017-02-26 11:10:40" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", - "version": "2.0.0", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "ecb0b2cdaa0add708fe6f329ef65ae0c5225130b" + "reference": "791198a2c6254db10131eecfe8c06670700904db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ecb0b2cdaa0add708fe6f329ef65ae0c5225130b", - "reference": "ecb0b2cdaa0add708fe6f329ef65ae0c5225130b", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" }, "require": { "ext-tokenizer": "*", @@ -805,27 +834,21 @@ "keywords": [ "tokenizer" ], - "time": "2017-08-03 14:17:41" + "time": "2017-11-27T05:48:46+00:00" }, { "name": "phpunit/phpunit", - "version": "5.7.21", + "version": "6.5.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db" + "reference": "83d27937a310f2984fd575686138597147bdc7df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3b91adfb64264ddec5a2dee9851f354aa66327db", - "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/83d27937a310f2984fd575686138597147bdc7df", + "reference": "83d27937a310f2984fd575686138597147bdc7df", + "shasum": "" }, "require": { "ext-dom": "*", @@ -833,33 +856,35 @@ "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0.3|~2.0", - "symfony/yaml": "~2.1|~3.0" + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.5", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" }, "require-dev": { "ext-pdo": "*" }, "suggest": { "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" + "phpunit/php-invoker": "^1.1" }, "bin": [ "phpunit" @@ -867,7 +892,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.7.x-dev" + "dev-master": "6.5.x-dev" } }, "autoload": { @@ -893,39 +918,33 @@ "testing", "xunit" ], - "time": "2017-06-21 08:11:54" + "time": "2017-12-17T06:31:19+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", + "version": "5.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/33fd41a76e746b8fa96d00b49a23dadfa8334cdf", + "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf", + "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" }, "conflict": { - "phpunit/phpunit": "<5.4.0" + "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "^5.4" + "phpunit/phpunit": "^6.5" }, "suggest": { "ext-soap": "*" @@ -933,7 +952,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "5.0.x-dev" } }, "autoload": { @@ -948,7 +967,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -958,7 +977,7 @@ "mock", "xunit" ], - "time": "2017-06-30 09:13:00" + "time": "2018-01-06T05:45:45+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -972,13 +991,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^5.6 || ^7.0" @@ -1009,40 +1022,34 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04 06:30:41" + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", - "version": "1.2.4", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "reference": "b11c729f95109b56a0fe9650c6a63a0fcd8c439f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/b11c729f95109b56a0fe9650c6a63a0fcd8c439f", + "reference": "b11c729f95109b56a0fe9650c6a63a0fcd8c439f", + "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": "^7.0", + "sebastian/diff": "^2.0", + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -1073,44 +1080,38 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2017-01-29 09:50:25" + "time": "2017-12-22T14:50:35+00:00" }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1137,38 +1138,32 @@ "keywords": [ "diff" ], - "time": "2017-05-22 07:24:03" + "time": "2017-08-03T08:09:46+00:00" }, { "name": "sebastian/environment", - "version": "2.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^6.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -1193,40 +1188,34 @@ "environment", "hhvm" ], - "time": "2016-11-26 07:53:53" + "time": "2017-07-01T08:51:00+00:00" }, { "name": "sebastian/exporter", - "version": "2.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -1266,33 +1255,27 @@ "export", "exporter" ], - "time": "2016-11-19 08:54:04" + "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-uopz": "*" @@ -1300,7 +1283,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1323,39 +1306,34 @@ "keywords": [ "global state" ], - "time": "2015-10-12 03:26:01" + "time": "2017-04-27T15:39:26+00:00" }, { "name": "sebastian/object-enumerator", - "version": "2.0.1", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" }, "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1375,38 +1353,77 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18 15:18:39" + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" }, { "name": "sebastian/recursion-context", - "version": "2.0.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1434,7 +1451,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19 07:33:16" + "time": "2017-03-03T06:23:57+00:00" }, { "name": "sebastian/resource-operations", @@ -1448,13 +1465,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.6.0" @@ -1482,7 +1493,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28 20:34:47" + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", @@ -1496,13 +1507,7 @@ "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": ">=5.6" @@ -1531,33 +1536,30 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03 07:35:21" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "symfony/yaml", - "version": "v3.3.6", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed" + "reference": "b84f646b9490d2101e2c25ddeec77ceefbda2eee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ddc23324e6cfe066f3dd34a37ff494fa80b617ed", - "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "url": "https://api.github.com/repos/symfony/yaml/zipball/b84f646b9490d2101e2c25ddeec77ceefbda2eee", + "reference": "b84f646b9490d2101e2c25ddeec77ceefbda2eee", + "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^7.1.3" + }, + "conflict": { + "symfony/console": "<3.4" }, "require-dev": { - "symfony/console": "~2.8|~3.0" + "symfony/console": "~3.4|~4.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -1565,7 +1567,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1592,7 +1594,47 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-07-23 12:43:26" + "time": "2018-01-03T07:38:00+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" }, { "name": "webmozart/assert", @@ -1606,13 +1648,7 @@ "type": "zip", "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", - "shasum": "", - "mirrors": [ - { - "url": "https://composer.etsycorp.com/repo/all/dists/%package%/%version%/%reference%.%type%", - "preferred": true - } - ] + "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0" @@ -1648,7 +1684,7 @@ "check", "validate" ], - "time": "2016-11-23 20:04:58" + "time": "2016-11-23T20:04:58+00:00" } ], "packages-dev": [], diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..742db44 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,23 @@ + + + + tests/Assert + tests/Constraint + tests/Database + tests/Helper + tests/MockObject + tests/MultipleDatabase + + + + + src + + + diff --git a/PHPUnit/Experimental/FileSystemTestSuite.php b/src/PHPUnit/Experimental/FileSystemTestSuite.php similarity index 100% rename from PHPUnit/Experimental/FileSystemTestSuite.php rename to src/PHPUnit/Experimental/FileSystemTestSuite.php diff --git a/PHPUnit/Experimental/PHPUI/Command.php b/src/PHPUnit/Experimental/PHPUI/Command.php similarity index 100% rename from PHPUnit/Experimental/PHPUI/Command.php rename to src/PHPUnit/Experimental/PHPUI/Command.php diff --git a/PHPUnit/Experimental/PHPUI/ResultPrinter.php b/src/PHPUnit/Experimental/PHPUI/ResultPrinter.php similarity index 100% rename from PHPUnit/Experimental/PHPUI/ResultPrinter.php rename to src/PHPUnit/Experimental/PHPUI/ResultPrinter.php diff --git a/PHPUnit/Extensions/Assert/More.php b/src/PHPUnit/Extensions/Assert/More.php similarity index 72% rename from PHPUnit/Extensions/Assert/More.php rename to src/PHPUnit/Extensions/Assert/More.php index 91b8458..96c926d 100644 --- a/PHPUnit/Extensions/Assert/More.php +++ b/src/PHPUnit/Extensions/Assert/More.php @@ -1,9 +1,16 @@ exporter = new Exporter; $this->setConstraints( array( - new PHPUnit_Extensions_Constraint_HasItems($expected), - new PHPUnit_Framework_Constraint_SameSize($expected) + new HasItems($expected), + new SameSize($expected) ) ); } diff --git a/PHPUnit/Extensions/Constraint/ArrayHasKeyValuePair.php b/src/PHPUnit/Extensions/Constraint/ArrayHasKeyValuePair.php similarity index 91% rename from PHPUnit/Extensions/Constraint/ArrayHasKeyValuePair.php rename to src/PHPUnit/Extensions/Constraint/ArrayHasKeyValuePair.php index 6924cd6..349f176 100644 --- a/PHPUnit/Extensions/Constraint/ArrayHasKeyValuePair.php +++ b/src/PHPUnit/Extensions/Constraint/ArrayHasKeyValuePair.php @@ -1,12 +1,15 @@ tables = $tables; foreach ($data as $table_name => $rows) { - $table = new PHPUnit_Extensions_Database_DataSet_DefaultTable( - new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData( + $table = new DefaultTable( + new DefaultTableMetaData( $table_name, $this->getColumns($rows) ) @@ -33,7 +40,7 @@ private function getColumns($rows) { } protected function createIterator($reverse=false) { - return new PHPUnit_Extensions_Database_DataSet_DefaultTableIterator( + return new DefaultTableIterator( $this->tables, $reverse ); diff --git a/PHPUnit/Extensions/Helper/AccessibleObject.php b/src/PHPUnit/Extensions/Helper/AccessibleObject.php similarity index 93% rename from PHPUnit/Extensions/Helper/AccessibleObject.php rename to src/PHPUnit/Extensions/Helper/AccessibleObject.php index 258b06a..aa90ebc 100644 --- a/PHPUnit/Extensions/Helper/AccessibleObject.php +++ b/src/PHPUnit/Extensions/Helper/AccessibleObject.php @@ -1,6 +1,9 @@ return_map as $entry) { if ($entry->matches($invocation)) { @@ -40,10 +45,10 @@ public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation) { return $this->default->invoke($invocation); } - PHPUnit_Framework_Assert::fail( + Assert::fail( sprintf( 'No return value defined for %s', - $this->exporter->export($invocation->parameters))); + $this->exporter->export($invocation->getParameters()))); } public function toString() { diff --git a/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Builder.php b/src/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Builder.php similarity index 64% rename from PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Builder.php rename to src/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Builder.php index 8094f0f..02a37cf 100644 --- a/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Builder.php +++ b/src/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Builder.php @@ -1,21 +1,24 @@ entry_builders = array(); - $this->default_entry = NULL; + $this->default_entry = null; } /** - * @return PHPUnit_Extensions_MockObject_Stub_ReturnMapping_EntryBuilder + * @return EntryBuilder */ public function addEntry() { $entry_builder = - new PHPUnit_Extensions_MockObject_Stub_ReturnMapping_EntryBuilder(); + new EntryBuilder(); $this->entry_builders[] = $entry_builder; return $entry_builder; } @@ -25,11 +28,12 @@ public function addEntry() { * * @param PHPUnit_Extensions_MockObject_Stub|mixed $default the default * return value. - * @return PHPUnit_Extensions_MockObject_Stub_ReturnMapping_Builder + * + * @return Builder */ public function setDefault($default) { $entry_builder = - new PHPUnit_Extensions_MockObject_Stub_ReturnMapping_EntryBuilder(); + new EntryBuilder(); $entry_builder ->with($this->anything()) ->will($default); @@ -40,14 +44,14 @@ public function setDefault($default) { } /** - * @return PHPUnit_Extensions_MockObject_Stub_ReturnMapping + * @return ReturnMapping */ public function build() { $entries = array(); foreach ($this->entry_builders as $builder) { $entries[] = $builder->build(); } - return new PHPUnit_Extensions_MockObject_Stub_ReturnMapping( + return new ReturnMapping( $entries, $this->default_entry ); diff --git a/src/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Entry.php b/src/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Entry.php new file mode 100644 index 0000000..cce0f98 --- /dev/null +++ b/src/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/Entry.php @@ -0,0 +1,36 @@ +parameters = $parameters; + $this->return = $return; + } + + public function matches(Invocation $invocation) { + try { + $this->parameters->matches($invocation); + return true; + } catch (ExpectationFailedException $ignore) { + return false; + } + } + + public function invoke(Invocation $invocation) { + if ($this->return instanceof Stub) { + return $this->return->invoke($invocation); + } + return $this->return; + } +} + diff --git a/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/EntryBuilder.php b/src/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/EntryBuilder.php similarity index 69% rename from PHPUnit/Extensions/MockObject/Stub/ReturnMapping/EntryBuilder.php rename to src/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/EntryBuilder.php index 4e86197..a5876a6 100644 --- a/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/EntryBuilder.php +++ b/src/PHPUnit/Extensions/MockObject/Stub/ReturnMapping/EntryBuilder.php @@ -1,6 +1,10 @@ parameters = $parameters; @@ -20,7 +25,8 @@ public function with(array $parameters) { /** * @param $return takes in either a raw return value or a * PHPUnit_Extensions_MockObject_Stub - * @return this + * + * @return EntryBuilder */ public function will($return) { $this->return = $return; @@ -28,16 +34,16 @@ public function will($return) { } /** - * @return PHPUnit_Extensions_MockObject_Stub_ReturnMapping_Entry + * @return Entry */ public function build() { - PHPUnit_Framework_Assert::assertNotNull( + Assert::assertNotNull( $this->parameters, "ReturnMapping cannot be used with null parameter list."); $parameter_matcher = - new PHPUnit_Framework_MockObject_Matcher_Parameters( + new Parameters( $this->parameters); - return new PHPUnit_Extensions_MockObject_Stub_ReturnMapping_Entry( + return new Entry( $parameter_matcher, $this->return); } } diff --git a/PHPUnit/Extensions/MultipleDatabase/DatabaseConfig.php b/src/PHPUnit/Extensions/MultipleDatabase/DatabaseConfig.php similarity index 94% rename from PHPUnit/Extensions/MultipleDatabase/DatabaseConfig.php rename to src/PHPUnit/Extensions/MultipleDatabase/DatabaseConfig.php index a40b06c..dd05b3a 100644 --- a/PHPUnit/Extensions/MultipleDatabase/DatabaseConfig.php +++ b/src/PHPUnit/Extensions/MultipleDatabase/DatabaseConfig.php @@ -1,9 +1,10 @@ setUpOperation = - PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT(); + Factory::CLEAN_INSERT(); $this->tearDownOperation = - PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE(); + Factory::TRUNCATE(); } /** * A connection must be provided. * - * @param PHPUnit_Extensions_Database_DB_IDatabaseConnection connection - * @return PHPUnit_Extensions_MultipleDatabase_DatabaseConfig_Builder + * @param Connection + * + * @return Builder */ public function connection($connection) { $this->connection = $connection; @@ -31,8 +42,9 @@ public function connection($connection) { /** * A data set must be provided. * - * @param PHPUnit_Extensions_Database_DataSet_IDataSet dataSet - * @return PHPUnit_Extensions_MultipleDatabase_DatabaseConfig_Builder + * @param IDataSet $dataSet + * + * @return Builder */ public function dataSet($dataSet) { $this->dataSet = $dataSet; @@ -42,8 +54,9 @@ public function dataSet($dataSet) { /** * Default set up operation is CLEAN_INSERT with cascading deletes. * - * @param PHPUnit_Extensions_Database_Operation_IDatabaseOperation setUpOperation - * @return PHPUnit_Extensions_MultipleDatabase_DatabaseConfig_Builder + * @param Operation $setUpOperation + * + * @return Builder */ public function setUpOperation($setUpOperation) { $this->setUpOperation = $setUpOperation; @@ -53,8 +66,9 @@ public function setUpOperation($setUpOperation) { /** * Default tear down operation is NONE. * - * @param PHPUnit_Extensions_Database_Operation_IDatabaseOperation tearDownOperation - * @return PHPUnit_Extensions_MultipleDatabase_DatabaseConfig_Builder + * @param Operation $tearDownOperation + * + * @return Builder */ public function tearDownOperation($tearDownOperation) { $this->tearDownOperation = $tearDownOperation; @@ -62,7 +76,7 @@ public function tearDownOperation($tearDownOperation) { } /** - * @return PHPUnit_Extensions_MultipleDatabase_DatabaseConfig_Builder + * @return Builder */ public function build() { if (!isset($this->connection)) { @@ -75,7 +89,7 @@ public function build() { if($this->datasetIsEmpty()) { throw new Exception("Empty dataset (is the path correct?)"); } - return new PHPUnit_Extensions_MultipleDatabase_DatabaseConfig( + return new DatabaseConfig( $this->connection, $this->dataSet, $this->setUpOperation, diff --git a/PHPUnit/Extensions/MultipleDatabase/TestCase.php b/src/PHPUnit/Extensions/MultipleDatabase/TestCase.php similarity index 72% rename from PHPUnit/Extensions/MultipleDatabase/TestCase.php rename to src/PHPUnit/Extensions/MultipleDatabase/TestCase.php index 9012a65..acb0370 100644 --- a/PHPUnit/Extensions/MultipleDatabase/TestCase.php +++ b/src/PHPUnit/Extensions/MultipleDatabase/TestCase.php @@ -1,11 +1,15 @@ testers = array(); foreach ($this->getDatabaseConfigs() as $dbConfig) { $this->testers[] = - new PHPUnit_Extensions_MultipleDatabase_Tester( + new Tester( $dbConfig); } } diff --git a/PHPUnit/Extensions/MultipleDatabase/Tester.php b/src/PHPUnit/Extensions/MultipleDatabase/Tester.php similarity index 80% rename from PHPUnit/Extensions/MultipleDatabase/Tester.php rename to src/PHPUnit/Extensions/MultipleDatabase/Tester.php index bd02ec3..e50f63e 100644 --- a/PHPUnit/Extensions/MultipleDatabase/Tester.php +++ b/src/PHPUnit/Extensions/MultipleDatabase/Tester.php @@ -1,11 +1,14 @@ 'value')); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testAssertHasItems_fails() { + More::assertHasItems( + array(4), + array(1, 2, 3)); + } + + public function testAssertArrayEqualsNoOrder_passes() { + More::assertArrayEqualsNoOrder( + array(1, 2, 3), + array(3, 1, 2)); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testAssertArrayEqualsNoOrder_sameSize() { + More::assertArrayEqualsNoOrder( + array(1, 2, 3), + array(4, 5, 6)); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testAssertArrayEqualsNoOrder_duplicates() { + More::assertArrayEqualsNoOrder( + array(1, 2, 3), + array(1, 1, 2, 3)); + } + + public function testAssertStringMatchIgnoreWhitespace_passes() { + More::assertStringMatchIgnoreWhitespace( + "spaces do not matter", + "spaces\ndo\tnot matter "); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testAssertStringMatchIgnoreWhitespace_fails() { + More::assertStringMatchIgnoreWhitespace( + "spaces do not matter", + "but the not whitespace characters do!"); + } +} + diff --git a/tests/Constraint/ArrayEqualsNoOrderTest.php b/tests/Constraint/ArrayEqualsNoOrderTest.php new file mode 100644 index 0000000..7d2b357 --- /dev/null +++ b/tests/Constraint/ArrayEqualsNoOrderTest.php @@ -0,0 +1,22 @@ + 1 1 => 2 2 => 3 ) and count matches 3', + $constraint->toString()); + } +} + diff --git a/tests/Constraint/ArrayHasKeyValuePairTest.php b/tests/Constraint/ArrayHasKeyValuePairTest.php new file mode 100644 index 0000000..401e052 --- /dev/null +++ b/tests/Constraint/ArrayHasKeyValuePairTest.php @@ -0,0 +1,119 @@ +evaluate(null); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testEvaluate_nullExpected() { + $constraint = new ArrayHasKeyValuePair(null, null); + $constraint->evaluate(array(1, 2, 3)); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testEvaluate_nullActual() { + $constraint = + new ArrayHasKeyValuePair('key', 'value'); + $constraint->evaluate(null); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testEvaluate_empty() { + $constraint = new ArrayHasKeyValuePair('key', 'value'); + $constraint->evaluate(array()); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testEvaluate_emptyExpected() { + $constraint = + new ArrayHasKeyValuePair(null, array()); + $constraint->evaluate(array(1, 2, 3)); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testEvaluate_emptyActual() { + $constraint = + new ArrayHasKeyValuePair('key', 'value'); + $constraint->evaluate(array()); + } + + public function testEvaluate_equal() { + $constraint = + new ArrayHasKeyValuePair('key', 'value'); + $result = $constraint->evaluate(array('key' => 'value'), '', true); + $this->assertTrue($result); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testEvaluate_keyMatchOnly() { + $constraint = + new ArrayHasKeyValuePair('key', 'missing'); + $constraint->evaluate(array('key' => null)); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testEvaluate_valueMatchOnly() { + $constraint = + new ArrayHasKeyValuePair('WRONG', 'value'); + $constraint->evaluate(array('NO MATCH' => 'value')); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testEvaluate_existButNotPaired() { + $constraint = + new ArrayHasKeyValuePair('key', 'value'); + $constraint->evaluate(array('key' => 1, 'value')); + } + + public function testEvaluate_multiDimensional() { + $constraint = + new ArrayHasKeyValuePair('key', array(1, 2, 3)); + $result = $constraint->evaluate(array('key' => array(1, 2, 3)), '', true); + $this->assertTrue($result); + } + + public function testEvaluate_duplicateValue() { + $constraint = + new ArrayHasKeyValuePair('key', 'value'); + $result = $constraint->evaluate(array(1, 'value', 2, 'value', 'key' => 'value', 3), '', true); + $this->assertTrue($result); + } + + public function testToString() { + $constraint = + new ArrayHasKeyValuePair('KEY', 'VALUE'); + More::assertStringMatchIgnoreWhitespace( + "has the key 'KEY' with the value 'VALUE'", + $constraint->toString()); + } +} + diff --git a/Tests/Extensions/Constraint/EqualsClosureTest.php b/tests/Constraint/EqualsClosureTest.php similarity index 81% rename from Tests/Extensions/Constraint/EqualsClosureTest.php rename to tests/Constraint/EqualsClosureTest.php index 7346478..4d02f6b 100644 --- a/Tests/Extensions/Constraint/EqualsClosureTest.php +++ b/tests/Constraint/EqualsClosureTest.php @@ -1,9 +1,12 @@ assertThat( $actual, - new PHPUnit_Extensions_Constraint_EqualsClosure( + new EqualsClosure( $expected, function($expected, $actual) { return $expected->id === $actual->id @@ -28,8 +31,8 @@ function($expected, $actual) { public function testContraintMisMatches($expected, $actual) { $this->assertThat( $actual, - new PHPUnit_Framework_Constraint_Not( - new PHPUnit_Extensions_Constraint_EqualsClosure( + new LogicalNot( + new EqualsClosure( $expected, function($expected, $actual) { return $expected->id === $actual->id @@ -42,13 +45,13 @@ function($expected, $actual) { } public function provideMatchingObjects() { - $object_a = new StdClass; + $object_a = new stdClass; $object_a->id = 1; $object_a->first = 'bob'; $object_a->last = 'johnson'; $object_a->age = 21; - $object_b = new StdClass; + $object_b = new stdClass; $object_b->id = 1; $object_b->first = 'bob'; $object_b->last = 'johnson'; @@ -61,13 +64,13 @@ public function provideMatchingObjects() { } public function provideMismatchingObjects() { - $object_a = new StdClass; + $object_a = new stdClass; $object_a->id = 1; $object_a->first = 'bob'; $object_a->last = 'johnson'; $object_a->age = 21; - $object_c = new StdClass; + $object_c = new stdClass; $object_c->id = 2; $object_c->first = 'bob'; $object_c->last = 'johnson'; diff --git a/tests/Constraint/HasItemsTest.php b/tests/Constraint/HasItemsTest.php new file mode 100644 index 0000000..8dbdc0f --- /dev/null +++ b/tests/Constraint/HasItemsTest.php @@ -0,0 +1,109 @@ +evaluate(null); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testEvaluate_nullExpected() { + $constraint = new HasItems(null); + $constraint->evaluate(array(1, 2, 3)); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testEvaluate_nullActual() { + $constraint = + new HasItems(array(1, 2, 3)); + $constraint->evaluate(null); + } + + public function testEvaluate_empty() { + $constraint = new HasItems(array()); + $result = $constraint->evaluate(array(), '', true); + $this->assertTrue($result); + } + + public function testEvaluate_emptyExpected() { + $constraint = + new HasItems(array()); + $result = $constraint->evaluate(array(1, 2, 3), '', true); + $this->assertTrue($result); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testEvaluate_emptyActual() { + $constraint = + new HasItems(array(1, 2, 3)); + $constraint->evaluate(array()); + } + + public function testEvaluate_equal() { + $constraint = + new HasItems(array(1, 2, 3)); + $result = $constraint->evaluate(array(1, 2, 3), '', true); + $this->assertTrue($result); + } + + public function testEvaluate_sameDifferentOrder() { + $constraint = + new HasItems(array(1, 2, 3)); + $result = $constraint->evaluate(array(3, 1, 2), '', true); + $this->assertTrue($result); + } + + public function testEvaluate_duplicateExpected() { + $constraint = + new HasItems(array(1, 1, 2, 2, 3, 3)); + $result = $constraint->evaluate(array(1, 2, 3), '', true); + $this->assertTrue($result); + } + + public function testEvaluate_duplicateActual() { + $constraint = + new HasItems(array(1, 2, 3)); + $result = $constraint->evaluate(array(1, 1, 2, 2, 3, 3), '', true); + $this->assertTrue($result); + } + + public function testEvaluate_moreThanExpected() { + $constraint = + new HasItems(array(1, 2, 3)); + $result = $constraint->evaluate(array(1, 0, 2, 3), '', true); + $this->assertTrue($result); + } + + /** + * @expectedException \PHPUnit\Framework\AssertionFailedError + */ + public function testEvaluate_lessThanExpected() { + $constraint = new HasItems(array(1, 0, 2, 3)); + $constraint->evaluate(array(1, 2, 3)); + } + + public function testToString() { + $constraint = new HasItems(array(1, 2, 3)); + More::assertStringMatchIgnoreWhitespace( + 'has items Array ( 0 => 1 1 => 2 2 => 3 )', + $constraint->toString()); + } +} + diff --git a/Tests/Extensions/Constraint/StringMatchIgnoreWhitespaceTest.php b/tests/Constraint/StringMatchIgnoreWhitespaceTest.php similarity index 52% rename from Tests/Extensions/Constraint/StringMatchIgnoreWhitespaceTest.php rename to tests/Constraint/StringMatchIgnoreWhitespaceTest.php index f822c8b..7615f60 100644 --- a/Tests/Extensions/Constraint/StringMatchIgnoreWhitespaceTest.php +++ b/tests/Constraint/StringMatchIgnoreWhitespaceTest.php @@ -1,65 +1,71 @@ evaluate('trim'); + $result = $constraint->evaluate('trim', '', true); + $this->assertTrue($result); } public function testEvaluate_trimActual() { $constraint = - new PHPUnit_Extensions_Constraint_StringMatchIgnoreWhitespace( + new StringMatchIgnoreWhitespace( 'trim'); - $constraint->evaluate(' trim '); + $result = $constraint->evaluate(' trim ', '', true); + $this->assertTrue($result); } public function testEvaluate_newlineExpected() { $constraint = - new PHPUnit_Extensions_Constraint_StringMatchIgnoreWhitespace( + new StringMatchIgnoreWhitespace( "new\nline"); - $constraint->evaluate('new line'); + $result = $constraint->evaluate('new line', '', true); + $this->assertTrue($result); } public function testEvaluate_newlineActual() { $constraint = - new PHPUnit_Extensions_Constraint_StringMatchIgnoreWhitespace( + new StringMatchIgnoreWhitespace( 'new line'); - $constraint->evaluate("new\nline"); + $result = $constraint->evaluate("new\nline", '', true); + $this->assertTrue($result); } public function testEvaluate_equal() { $constraint = - new PHPUnit_Extensions_Constraint_StringMatchIgnoreWhitespace( + new StringMatchIgnoreWhitespace( 'are equal'); - $constraint->evaluate('are equal'); + $result = $constraint->evaluate('are equal', '', true); + $this->assertTrue($result); } /** - * @expectedException PHPUnit_Framework_AssertionFailedError + * @expectedException \PHPUnit\Framework\AssertionFailedError */ public function testEvaluate_notEqual() { $constraint = - new PHPUnit_Extensions_Constraint_StringMatchIgnoreWhitespace( + new StringMatchIgnoreWhitespace( 'not equal'); $constraint->evaluate('are not equal'); } public function testFailureDescription_throughAssert() { $constraint = - new PHPUnit_Extensions_Constraint_StringMatchIgnoreWhitespace( + new StringMatchIgnoreWhitespace( "new\nline"); try { $constraint->evaluate("\ttab"); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { + } catch (ExpectationFailedException $e) { $this->assertEquals( "Failed asserting that '\ttab'" . ' equals ignoring whitespace \'new line\'.', @@ -69,7 +75,7 @@ public function testFailureDescription_throughAssert() { public function testToString() { $constraint = - new PHPUnit_Extensions_Constraint_StringMatchIgnoreWhitespace( + new StringMatchIgnoreWhitespace( 'expected string'); $this->assertEquals( 'equals ignoring whitespace \'expected string\'', diff --git a/Tests/Extensions/Database/DataSet/EtsyArrayDataSetTest.php b/tests/Database/DataSet/EtsyArrayDataSetTest.php similarity index 78% rename from Tests/Extensions/Database/DataSet/EtsyArrayDataSetTest.php rename to tests/Database/DataSet/EtsyArrayDataSetTest.php index 1257e63..ba78ac5 100644 --- a/Tests/Extensions/Database/DataSet/EtsyArrayDataSetTest.php +++ b/tests/Database/DataSet/EtsyArrayDataSetTest.php @@ -1,15 +1,23 @@ data_set = new PHPUnit_Extensions_Database_DataSet_EtsyArrayDataSet( + $this->data_set = new EtsyArrayDataSet( array( 'table_a' => array( array( @@ -39,8 +47,8 @@ protected function setUp() { } public function testGetTable_a() { - $expected = new PHPUnit_Extensions_Database_DataSet_DefaultTable( - new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData( + $expected = new DefaultTable( + new DefaultTableMetaData( 'table_a', array('id', 'first', 'last', 'age') ) ); @@ -62,13 +70,13 @@ public function testGetTable_a() { $this->assertThat( $this->data_set->getTable('table_a'), - new PHPUnit_Extensions_Database_Constraint_TableIsEqual($expected) + new TableIsEqual($expected) ); } public function testGetTable_b() { - $expected = new PHPUnit_Extensions_Database_DataSet_DefaultTable( - new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData( + $expected = new DefaultTable( + new DefaultTableMetaData( 'table_b', array('id', 'pet') ) ); @@ -87,7 +95,7 @@ public function testGetTable_b() { $this->assertThat( $this->data_set->getTable('table_b'), - new PHPUnit_Extensions_Database_Constraint_TableIsEqual($expected) + new TableIsEqual($expected) ); } @@ -100,7 +108,7 @@ public function testGetTable_doesNotExist() { } public function testEmpty() { - $data_set = new PHPUnit_Extensions_Database_DataSet_EtsyArrayDataSet( + $data_set = new EtsyArrayDataSet( array() ); $this->assertNotNull($data_set); @@ -147,21 +155,21 @@ public function testEmpty_getReverseIterator($data_set) { public function testEmpty_matches($data_set) { $this->assertTrue( $data_set->matches( - new PHPUnit_Extensions_Database_DataSet_DefaultDataSet() + new DefaultDataSet() ) ); } public function testEmptyTable() { $tables = array( - 'my_table' => new PHPUnit_Extensions_Database_DataSet_DefaultTable( - new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData( + 'my_table' => new DefaultTable( + new DefaultTableMetaData( 'my_table', array() ) ) ); - $data_set = new PHPUnit_Extensions_Database_DataSet_EtsyArrayDataSet( + $data_set = new EtsyArrayDataSet( array(), $tables ); @@ -173,7 +181,7 @@ public function testEmptyTable() { * @depends testEmptyTable */ public function testEmptyTable_getTableNames($tables) { - $data_set = new PHPUnit_Extensions_Database_DataSet_EtsyArrayDataSet( + $data_set = new EtsyArrayDataSet( array(), $tables ); @@ -184,13 +192,12 @@ public function testEmptyTable_getTableNames($tables) { * @depends testEmptyTable */ public function testEmptyTable_getTableMetaData($tables) { - $data_set = new PHPUnit_Extensions_Database_DataSet_EtsyArrayDataSet( + $data_set = new EtsyArrayDataSet( array(), $tables ); $meta_data = $data_set->getTableMetaData('my_table'); - $this->assertInstanceOf( - 'PHPUnit_Extensions_Database_DataSet_ITableMetaData', + $this->assertInstanceOf(ITableMetadata::class, $meta_data ); return $meta_data; diff --git a/Tests/Extensions/Helper/AccessibleObjectTest.php b/tests/Helper/AccessibleObjectTest.php similarity index 89% rename from Tests/Extensions/Helper/AccessibleObjectTest.php rename to tests/Helper/AccessibleObjectTest.php index fb75a22..6338e2b 100644 --- a/Tests/Extensions/Helper/AccessibleObjectTest.php +++ b/tests/Helper/AccessibleObjectTest.php @@ -1,16 +1,18 @@ accessibleObject = new PHPUnit_Extensions_Helper_AccessibleObject( - new Tests_Extensions_Helper_AccessibleObject_Object() + $this->accessibleObject = new AccessibleObject( + new AccessibleObject_Object() ); } @@ -77,7 +79,7 @@ public function testProtectedMultipleCommentMethod_accessible() { } } -class Tests_Extensions_Helper_AccessibleObject_Object { +class AccessibleObject_Object { public $public_var; diff --git a/Tests/Extensions/MockObject/Stub/ReturnMappingTest.php b/tests/MockObject/Stub/ReturnMappingTest.php similarity index 75% rename from Tests/Extensions/MockObject/Stub/ReturnMappingTest.php rename to tests/MockObject/Stub/ReturnMappingTest.php index a0b6e4e..ad68bf9 100644 --- a/Tests/Extensions/MockObject/Stub/ReturnMappingTest.php +++ b/tests/MockObject/Stub/ReturnMappingTest.php @@ -1,21 +1,18 @@ createMock('Foo'); + $invocation = $this->createMock(Foo::class); $returnMapBuilder = - new PHPUnit_Extensions_MockObject_Stub_ReturnMapping_Builder(); + new Builder(); $returnMapBuilder->addEntry() ->with(array('hello')) ->will($this->returnValue('hello')); @@ -29,10 +26,10 @@ public function testInvoke_noMatch() { } public function testInvoke_matchOutOfOne() { - $invocation = $this->createMock('Foo'); + $invocation = $this->createMock(Foo::class); $returnMapBuilder = - new PHPUnit_Extensions_MockObject_Stub_ReturnMapping_Builder(); + new Builder(); $returnMapBuilder->addEntry() ->with(array('hello')) ->will($this->returnValue('hello')); @@ -47,10 +44,10 @@ public function testInvoke_matchOutOfOne() { public function testInvoke_matchOutOfMany() { - $invocation = $this->createMock('Foo'); + $invocation = $this->createMock(Foo::class); $returnMapBuilder = - new PHPUnit_Extensions_MockObject_Stub_ReturnMapping_Builder(); + new Builder(); $returnMapBuilder->addEntry() ->with(array('hello')) ->will($this->returnValue('hello')); @@ -68,10 +65,10 @@ public function testInvoke_matchOutOfMany() { } public function testInvoke_constraintLessThan() { - $invocation = $this->createMock('Foo'); + $invocation = $this->createMock(Foo::class); $returnMapBuilder = - new PHPUnit_Extensions_MockObject_Stub_ReturnMapping_Builder(); + new Builder(); $returnMapBuilder->addEntry() ->with(array($this->lessThan(5))) ->will($this->returnValue('less')); @@ -92,10 +89,10 @@ public function testInvoke_constraintLessThan() { } public function testInvoke_constraintGreaterThan() { - $invocation = $this->createMock('Foo'); + $invocation = $this->createMock(Foo::class); $returnMapBuilder = - new PHPUnit_Extensions_MockObject_Stub_ReturnMapping_Builder(); + new Builder(); $returnMapBuilder->addEntry() ->with(array($this->lessThan(5))) ->will($this->returnValue('less')); @@ -116,10 +113,10 @@ public function testInvoke_constraintGreaterThan() { } public function testInvoke_constraintEqual() { - $invocation = $this->createMock('Foo'); + $invocation = $this->createMock(Foo::class); $returnMapBuilder = - new PHPUnit_Extensions_MockObject_Stub_ReturnMapping_Builder(); + new Builder(); $returnMapBuilder->addEntry() ->with(array($this->lessThan(5))) ->will($this->returnValue('less')); diff --git a/Tests/Extensions/MultipleDatabase/DatabaseConfig/BuilderTest.php b/tests/MultipleDatabase/DatabaseConfig/BuilderTest.php similarity index 78% rename from Tests/Extensions/MultipleDatabase/DatabaseConfig/BuilderTest.php rename to tests/MultipleDatabase/DatabaseConfig/BuilderTest.php index 5b3218b..d0e75c6 100644 --- a/Tests/Extensions/MultipleDatabase/DatabaseConfig/BuilderTest.php +++ b/tests/MultipleDatabase/DatabaseConfig/BuilderTest.php @@ -1,22 +1,30 @@ builder = - new PHPUnit_Extensions_MultipleDatabase_DatabaseConfig_Builder(); + new Builder(); $this->dataSet = - $this->createMock('PHPUnit_Extensions_Database_DataSet_IDataSet'); + + $this->createMock(IDataSet::class); $this->dataSet ->expects($this->any()) ->method('getIterator') @@ -33,10 +41,11 @@ public function testBuild_whenConnectionNotSet() { } public function testConnection() { - $connection = $this->createMock( - 'PHPUnit_Extensions_Database_DB_IDatabaseConnection'); + $connection = $this->createMock(Connection::class); $this->builder->connection($connection); + + $this->assertTrue(true); return $connection; } @@ -55,6 +64,8 @@ public function testBuild_whenDataSetNotSet($connection) { public function testDataSet() { $this->builder->dataSet($this->dataSet); + + $this->assertTrue(true); } /** @@ -104,7 +115,7 @@ public function testBuild_withDefaultOperationsHasDefaultSetUpOperation( ->dataSet($this->dataSet) ->build(); $this->assertEquals( - PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT(), + Factory::CLEAN_INSERT(), $dbConfig->getSetUpOperation()); } @@ -119,7 +130,7 @@ public function testBuild_withDefaultOperationsHasDefaultTearDownOperation( ->dataSet($this->dataSet) ->build(); $this->assertEquals( - PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE(), + Factory::TRUNCATE(), $dbConfig->getTearDownOperation()); } @@ -127,8 +138,7 @@ public function testBuild_withDefaultOperationsHasDefaultTearDownOperation( * @depends testConnection */ public function testSetUpOperation($connection) { - $setUpOperation = $this->createMock( - 'PHPUnit_Extensions_Database_Operation_IDatabaseOperation'); + $setUpOperation = $this->createMock(Operation::class); $dbConfig = $this->builder ->connection($connection) ->dataSet($this->dataSet) @@ -141,8 +151,7 @@ public function testSetUpOperation($connection) { * @depends testConnection */ public function testTearDownOperation($connection) { - $tearDownOperation = $this->createMock( - 'PHPUnit_Extensions_Database_Operation_IDatabaseOperation'); + $tearDownOperation = $this->createMock(Operation::class); $dbConfig = $this->builder ->connection($connection) ->dataSet($this->dataSet) diff --git a/tests/MultipleDatabase/DatabaseConfigTest.php b/tests/MultipleDatabase/DatabaseConfigTest.php new file mode 100644 index 0000000..8096f72 --- /dev/null +++ b/tests/MultipleDatabase/DatabaseConfigTest.php @@ -0,0 +1,55 @@ +getMockBuilder(Connection::class)->getMock(); + $dbConfig = new DatabaseConfig( + $connection, + NULL, + NULL, + NULL); + $this->assertEquals($connection, $dbConfig->getConnection()); + } + + public function testGetDataSet() { + $dataSet = $this->getMockBuilder(IDataSet::class)->getMock(); + $dbConfig = new DatabaseConfig( + NULL, + $dataSet, + NULL, + NULL); + $this->assertEquals($dataSet, $dbConfig->getDataSet()); + } + + public function testGetSetUpOperation() { + $setUpOperation = $this->getMockBuilder(Operation::class)->getMock(); + $dbConfig = new DatabaseConfig( + NULL, + NULL, + $setUpOperation, + NULL); + $this->assertEquals($setUpOperation, $dbConfig->getSetUpOperation()); + } + + public function testGetTearDownOperation() { + $tearDownOperation = $this->getMockBuilder(Operation::class)->getMock(); + $dbConfig = new DatabaseConfig( + NULL, + NULL, + NULL, + $tearDownOperation); + $this->assertEquals($tearDownOperation, $dbConfig->getTearDownOperation()); + } +} + diff --git a/Tests/Extensions/MultipleDatabase/TestCaseTest.php b/tests/MultipleDatabase/TestCaseTest.php similarity index 65% rename from Tests/Extensions/MultipleDatabase/TestCaseTest.php rename to tests/MultipleDatabase/TestCaseTest.php index d31b81a..7566115 100644 --- a/Tests/Extensions/MultipleDatabase/TestCaseTest.php +++ b/tests/MultipleDatabase/TestCaseTest.php @@ -1,19 +1,26 @@ dataSet = - $this->createMock('PHPUnit_Extensions_Database_DataSet_IDataSet'); + $this->createMock(IDataSet::class); $this->dataSet ->expects($this->any()) ->method('getIterator') @@ -23,29 +30,29 @@ protected function setUp() { public function testGetDatabaseTesters() { $dbConfigs = array(); $builder = - new PHPUnit_Extensions_MultipleDatabase_DatabaseConfig_Builder(); + new Builder(); $dbConfigs[] = $builder ->connection( $this->createMock( - 'PHPUnit_Extensions_Database_DB_IDatabaseConnection')) + Connection::class)) ->dataSet($this->dataSet) ->build(); $builder = - new PHPUnit_Extensions_MultipleDatabase_DatabaseConfig_Builder(); + new Builder(); $dbConfigs[] = $builder ->connection( $this->createMock( - 'PHPUnit_Extensions_Database_DB_IDatabaseConnection')) + Connection::class)) ->dataSet($this->dataSet) ->build(); $expected = array( - new PHPUnit_Extensions_MultipleDatabase_Tester($dbConfigs[0]), - new PHPUnit_Extensions_MultipleDatabase_Tester($dbConfigs[1])); + new Tester($dbConfigs[0]), + new Tester($dbConfigs[1])); $testCase = $this->getMockForAbstractClass( - 'PHPUnit_Extensions_MultipleDatabase_TestCase'); + TestCase::class); $testCase ->expects($this->any()) ->method('getDatabaseConfigs') @@ -60,7 +67,7 @@ public function testSetUpDatabaseTesters() { $testers = array(); $testers[] = $this->getMockBuilder( - 'PHPUnit_Extensions_MultipleDatabase_Tester') + Tester::class) ->disableOriginalConstructor() ->getMock(); $testers[0] @@ -68,7 +75,7 @@ public function testSetUpDatabaseTesters() { ->method('onSetUp'); $testers[] = $this->getMockBuilder( - 'PHPUnit_Extensions_MultipleDatabase_Tester') + Tester::class) ->disableOriginalConstructor() ->getMock(); $testers[1] @@ -76,7 +83,7 @@ public function testSetUpDatabaseTesters() { ->method('onSetUp'); $testCase = $this->getMockForAbstractClass( - 'PHPUnit_Extensions_MultipleDatabase_TestCase'); + TestCase::class); $testCase->setUpDatabaseTesters($testers); } @@ -85,7 +92,7 @@ public function testTearDownDatabaseTesters() { $testers = array(); $testers[] = $this->getMockBuilder( - 'PHPUnit_Extensions_MultipleDatabase_Tester') + Tester::class) ->disableOriginalConstructor() ->getMock(); $testers[0] @@ -93,7 +100,7 @@ public function testTearDownDatabaseTesters() { ->method('onTearDown'); $testers[] = $this->getMockBuilder( - 'PHPUnit_Extensions_MultipleDatabase_Tester') + Tester::class) ->disableOriginalConstructor() ->getMock(); $testers[1] @@ -101,7 +108,7 @@ public function testTearDownDatabaseTesters() { ->method('onTearDown'); $testCase = $this->getMockForAbstractClass( - 'PHPUnit_Extensions_MultipleDatabase_TestCase'); + TestCase::class); $testCase->tearDownDatabaseTesters($testers); } @@ -125,21 +132,19 @@ public function testTearDown($testCase) { } public function testAssertTablesEqual() { - $expected = new PHPUnit_Extensions_Database_DataSet_DefaultTable( - new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData( + $expected = new DefaultTable( + new DefaultTableMetaData( 'my_table', array() ) ); $actual = $expected; - PHPUnit_Extensions_MultipleDatabase_TestCase - ::assertTablesEqual($expected, $actual); + TestCase::assertTablesEqual($expected, $actual); } public function testAssertDataSetsEqual() { - $expected = new PHPUnit_Extensions_Database_DataSet_CompositeDataSet(); + $expected = new CompositeDataSet(); $actual = $expected; - PHPUnit_Extensions_MultipleDatabase_TestCase - ::assertDataSetsEqual($expected, $actual); + TestCase::assertDataSetsEqual($expected, $actual); } } diff --git a/Tests/Extensions/MultipleDatabase/TesterTest.php b/tests/MultipleDatabase/TesterTest.php similarity index 56% rename from Tests/Extensions/MultipleDatabase/TesterTest.php rename to tests/MultipleDatabase/TesterTest.php index 35c0dd6..abb4933 100644 --- a/Tests/Extensions/MultipleDatabase/TesterTest.php +++ b/tests/MultipleDatabase/TesterTest.php @@ -1,30 +1,26 @@ createMock( - 'PHPUnit_Extensions_Database_DB_IDatabaseConnection'); - $dataSet = $this->createMock( - 'PHPUnit_Extensions_Database_DataSet_IDataSet'); - $setUpOperation = $this->createMock( - 'PHPUnit_Extensions_Database_Operation_IDatabaseOperation'); - $tearDownOperation = $this->createMock( - 'PHPUnit_Extensions_Database_Operation_IDatabaseOperation'); + $connection = $this->createMock(Connection::class); + $dataSet = $this->createMock(IDataSet::class); + $setUpOperation = $this->createMock(Operation::class); + $tearDownOperation = $this->createMock(Operation::class); - $this->dbConfig = $this->getMockBuilder( - 'PHPUnit_Extensions_MultipleDatabase_DatabaseConfig') + $this->dbConfig = $this->getMockBuilder(DatabaseConfig::class) ->setConstructorArgs( array( $connection, @@ -53,7 +49,7 @@ protected function setUp() { public function testConstruct_setsConnectionCorrectly() { $tester = - new PHPUnit_Extensions_MultipleDatabase_Tester($this->dbConfig); + new Tester($this->dbConfig); $this->assertEquals( $this->dbConfig->getConnection(), $tester->getConnection());