Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

PHPUnit 6 #6378

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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"require-dev": {
"symfony/yaml": "~2.3|~3.0",
"phpunit/phpunit": "^5.7"
"phpunit/phpunit": "^6.0"
},
"suggest": {
"symfony/yaml": "If you want to use YAML Metadata Mapping Driver"
Expand Down
4 changes: 3 additions & 1 deletion tests/Doctrine/Tests/DoctrineTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

namespace Doctrine\Tests;

use PHPUnit\Framework\TestCase;

/**
* Base testcase class for all Doctrine testcases.
*/
abstract class DoctrineTestCase extends \PHPUnit_Framework_TestCase
abstract class DoctrineTestCase extends TestCase
{
}
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/ORM/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
use Doctrine\ORM\Query\ResultSetMapping;
use Doctrine\Tests\Models\DDC753\DDC753CustomRepository;
use ReflectionClass;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;

/**
* Tests for the Configuration object
* @author Marco Pivetta <[email protected]>
*/
class ConfigurationTest extends PHPUnit_Framework_TestCase
class ConfigurationTest extends TestCase
{
/**
* @var Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
use Doctrine\ORM\Decorator\EntityManagerDecorator;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query\ResultSetMapping;
use PHPUnit\Framework\TestCase;

class EntityManagerDecoratorTest extends \PHPUnit_Framework_TestCase
class EntityManagerDecoratorTest extends TestCase
{
const VOID_METHODS = [
'persist',
Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/Tests/ORM/EntityNotFoundExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
namespace Doctrine\Tests\ORM;

use Doctrine\ORM\EntityNotFoundException;
use PHPUnit\Framework\TestCase;

/**
* Tests for {@see \Doctrine\ORM\EntityNotFoundException}
*
* @covers \Doctrine\ORM\EntityNotFoundException
*/
class EntityNotFoundExceptionTest extends \PHPUnit_Framework_TestCase
class EntityNotFoundExceptionTest extends TestCase
{
public function testFromClassNameAndIdentifier()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\Event\OnClassMetadataNotFoundEventArgs;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;

/**
* Tests for {@see \Doctrine\ORM\Event\OnClassMetadataNotFoundEventArgs}
*
* @covers \Doctrine\ORM\Event\OnClassMetadataNotFoundEventArgs
*/
class OnClassMetadataNotFoundEventArgsTest extends PHPUnit_Framework_TestCase
class OnClassMetadataNotFoundEventArgsTest extends TestCase
{
public function testEventArgsMutability()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2359Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\ClassMetadataFactory;
use PHPUnit\Framework\TestCase;

/**
* @group DDC-2359
*/
class DDC2359Test extends \PHPUnit_Framework_TestCase
class DDC2359Test extends TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
use Doctrine\ORM\Events;
use Doctrine\ORM\Internal\HydrationCompleteHandler;
use Doctrine\ORM\Mapping\ClassMetadata;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;
use stdClass;

/**
* Tests for {@see \Doctrine\ORM\Internal\HydrationCompleteHandler}
*
* @covers \Doctrine\ORM\Internal\HydrationCompleteHandler
*/
class HydrationCompleteHandlerTest extends PHPUnit_Framework_TestCase
class HydrationCompleteHandlerTest extends TestCase
{
/**
* @var \Doctrine\ORM\Event\ListenersInvoker|\PHPUnit_Framework_MockObject_MockObject
Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/Tests/ORM/LazyCriteriaCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\LazyCriteriaCollection;
use Doctrine\ORM\Persisters\Entity\EntityPersister;
use PHPUnit\Framework\TestCase;
use stdClass;

/**
* @author Marco Pivetta <[email protected]>
*
* @covers \Doctrine\ORM\LazyCriteriaCollection
*/
class LazyCriteriaCollectionTest extends \PHPUnit_Framework_TestCase
class LazyCriteriaCollectionTest extends TestCase
{
/**
* @var \Doctrine\ORM\Persisters\Entity\EntityPersister|\PHPUnit_Framework_MockObject_MockObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
use Doctrine\ORM\Mapping\Reflection\ReflectionPropertiesGetter;
use Doctrine\Tests\Models\Reflection\ClassWithMixedProperties;
use Doctrine\Tests\Models\Reflection\ParentClass;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;
use ReflectionClass;

/**
* Tests for {@see \Doctrine\ORM\Mapping\Reflection\ReflectionPropertiesGetter}
*
* @covers \Doctrine\ORM\Mapping\Reflection\ReflectionPropertiesGetter
*/
class ReflectionPropertiesGetterTest extends PHPUnit_Framework_TestCase
class ReflectionPropertiesGetterTest extends TestCase
{
public function testRetrievesProperties()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
use Doctrine\Tests\Models\Reflection\AbstractEmbeddable;
use Doctrine\Tests\Models\Reflection\ArrayObjectExtendingClass;
use Doctrine\Tests\Models\Reflection\ConcreteEmbeddable;
use PHPUnit\Framework\TestCase;
use ReflectionProperty;

/**
* Tests for {@see \Doctrine\ORM\Mapping\ReflectionEmbeddedProperty}
*
* @covers \Doctrine\ORM\Mapping\ReflectionEmbeddedProperty
*/
class ReflectionEmbeddedPropertyTest extends \PHPUnit_Framework_TestCase
class ReflectionEmbeddedPropertyTest extends TestCase
{
/**
* @param ReflectionProperty $parentProperty property of the embeddable/entity where to write the embeddable to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

namespace Doctrine\Tests\ORM\Mapping\Symfony;
use Doctrine\Common\Persistence\Mapping\MappingException;
use PHPUnit\Framework\TestCase;

/**
* @group DDC-1418
*/
abstract class AbstractDriverTest extends \PHPUnit_Framework_TestCase
abstract class AbstractDriverTest extends TestCase
{
public function testFindMappingFile()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/Tests/ORM/ORMInvalidArgumentExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
use Doctrine\Tests\Models\GeoNames\City;
use Doctrine\Tests\Models\GeoNames\Country;
use Doctrine\Tests\OrmTestCase;
use PHPUnit\Framework\TestCase;
use stdClass;

/**
* @covers \Doctrine\ORM\ORMInvalidArgumentException
*/
class ORMInvalidArgumentExceptionTest extends \PHPUnit_Framework_TestCase
class ORMInvalidArgumentExceptionTest extends TestCase
{
/**
* @dataProvider invalidEntityNames
Expand Down
2 changes: 2 additions & 0 deletions tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function assertValidDQL($dql, $debug = false)
{
try {
$parserResult = $this->parseDql($dql);
$this->addToAssertionCount(1);
} catch (QueryException $e) {
if ($debug) {
echo $e->getTraceAsString() . PHP_EOL;
Expand All @@ -44,6 +45,7 @@ public function assertInvalidDQL($dql, $debug = false)
echo $e->getMessage() . PHP_EOL;
echo $e->getTraceAsString() . PHP_EOL;
}
$this->addToAssertionCount(1);
}
}

Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/Tests/ORM/Query/ParserResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
use Doctrine\ORM\Query\Exec\AbstractSqlExecutor;
use Doctrine\ORM\Query\ParserResult;
use Doctrine\ORM\Query\ResultSetMapping;
use PHPUnit\Framework\TestCase;

class ParserResultTest extends \PHPUnit_Framework_TestCase
class ParserResultTest extends TestCase
{
public $parserResult;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
use Doctrine\ORM\Query\Expr as QueryBuilder;
use Doctrine\ORM\Query\Parameter;
use Doctrine\ORM\Query\QueryExpressionVisitor;
use PHPUnit\Framework\TestCase;

/**
* Test for QueryExpressionVisitor
*
* @author Kirill chEbba Chebunin <[email protected]>
*/
class QueryExpressionVisitorTest extends \PHPUnit_Framework_TestCase
class QueryExpressionVisitorTest extends TestCase
{
/**
* @var QueryExpressionVisitor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
use Doctrine\ORM\Repository\DefaultRepositoryFactory;
use Doctrine\Tests\Models\DDC753\DDC753DefaultRepository;
use Doctrine\Tests\Models\DDC869\DDC869PaymentRepository;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;

/**
* Tests for {@see \Doctrine\ORM\Repository\DefaultRepositoryFactory}
*
* @covers \Doctrine\ORM\Repository\DefaultRepositoryFactory
*/
class DefaultRepositoryFactoryTest extends PHPUnit_Framework_TestCase
class DefaultRepositoryFactoryTest extends TestCase
{
/**
* @var \Doctrine\ORM\EntityManagerInterface|\PHPUnit_Framework_MockObject_MockObject
Expand Down
9 changes: 5 additions & 4 deletions tests/Doctrine/Tests/OrmFunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Doctrine\Tests\DbalTypes\Rot13Type;
use Doctrine\Tests\EventListener\CacheMetadataListener;
use Doctrine\Tests\Models;
use PHPUnit\Framework\AssertionFailedError;

/**
* Base testcase class for all functional ORM testcases.
Expand Down Expand Up @@ -750,15 +751,15 @@ protected function _getEntityManager($config = null, $eventManager = null) {
}

/**
* @param \Exception $e
* @param \Throwable $e
*
* @return void
*
* @throws \Exception
* @throws \Throwable
*/
protected function onNotSuccessfulTest($e)
protected function onNotSuccessfulTest(\Throwable $e)
{
if ($e instanceof \PHPUnit_Framework_AssertionFailedError) {
if ($e instanceof AssertionFailedError) {
throw $e;
}

Expand Down