Skip to content

Commit

Permalink
Put all test cases under a common TestCase class
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Oct 28, 2024
1 parent e08ddff commit 5c3b987
Show file tree
Hide file tree
Showing 39 changed files with 66 additions and 37 deletions.
2 changes: 1 addition & 1 deletion tests/Feature/Auth/DoctrineUserProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
use LaravelDoctrine\ORM\Auth\DoctrineUserProvider;
use LaravelDoctrineTest\ORM\Assets\Auth\AuthenticableMock;
use LaravelDoctrineTest\ORM\Assets\Auth\AuthenticableWithNonEmptyConstructorMock;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class DoctrineUserProviderTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
use Illuminate\Contracts\Hashing\Hasher;
use LaravelDoctrine\ORM\Auth\Passwords\DoctrineTokenRepository;
use LaravelDoctrineTest\ORM\Assets\Auth\Passwords\UserMock;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class DoctrineTokenRepositoryTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace LaravelDoctrineTest\ORM\Feature\Configuration\Cache;

use LaravelDoctrineTest\ORM\TestCase;
use Mockery;
use PHPUnit\Framework\TestCase;

abstract class AbstractCacheProviderTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Configuration/Cache/CacheManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
use LaravelDoctrine\ORM\Configuration\Cache\CacheManager;
use LaravelDoctrine\ORM\Configuration\Cache\FileCacheProvider;
use LaravelDoctrine\ORM\Exceptions\DriverNotFound;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Cache\Adapter\ArrayAdapter;

class CacheManagerTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use Illuminate\Contracts\Cache\Factory;
use Illuminate\Contracts\Cache\Repository;
use LaravelDoctrine\ORM\Configuration\Cache\IlluminateCacheProvider;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class IlluminateCacheProviderTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use LaravelDoctrine\ORM\Configuration\Connections\MysqlConnection;
use LaravelDoctrine\ORM\Configuration\Connections\SqliteConnection;
use LaravelDoctrine\ORM\Exceptions\DriverNotFound;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class ConnectionManagerTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use Illuminate\Contracts\Config\Repository;
use LaravelDoctrine\ORM\Configuration\Connections\MysqlConnection;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class MysqlConnectionTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use Illuminate\Contracts\Config\Repository;
use LaravelDoctrine\ORM\Configuration\Connections\OracleConnection;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class OracleConnectionTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use Illuminate\Contracts\Config\Repository;
use LaravelDoctrine\ORM\Configuration\Connections\PgsqlConnection;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class PgsqlConnectionTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Doctrine\DBAL\Connections\PrimaryReadReplicaConnection as PrimaryReadReplicaDoctrineWrapper;
use Illuminate\Contracts\Config\Repository;
use LaravelDoctrine\ORM\Configuration\Connections\PrimaryReadReplicaConnection;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use PHPUnit\Framework\TestCase;

/**
* Basic unit tests for primary read-replica connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use Illuminate\Contracts\Config\Repository;
use LaravelDoctrine\ORM\Configuration\Connections\SqliteConnection;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class SqliteConnectionTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use Illuminate\Contracts\Config\Repository;
use LaravelDoctrine\ORM\Configuration\Connections\SqlsrvConnection;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class SqlsrvConnectionTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Configuration/CustomTypeManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use LaravelDoctrine\ORM\Configuration\CustomTypeManager;
use LaravelDoctrineTest\ORM\Assets\Configuration\TypeMock;
use LaravelDoctrineTest\ORM\Assets\Configuration\TypeMock2;
use PHPUnit\Framework\TestCase;
use LaravelDoctrineTest\ORM\TestCase;

class CustomTypeManagerTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Configuration/LaravelNamingStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Support\Str;
use LaravelDoctrine\ORM\Configuration\LaravelNamingStrategy;
use PHPUnit\Framework\TestCase;
use LaravelDoctrineTest\ORM\TestCase;

class LaravelNamingStrategyTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Configuration/MetaData/AttributesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use LaravelDoctrine\ORM\Configuration\MetaData\Attributes;
use Doctrine\Persistence\Mapping\Driver\MappingDriver;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class AttributesTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use Illuminate\Contracts\Container\Container;
use LaravelDoctrine\ORM\Configuration\MetaData\MetaDataManager;
use LaravelDoctrine\ORM\Exceptions\DriverNotFound;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class MetaDataManagerTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Configuration/MetaData/PhpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Doctrine\Persistence\Mapping\Driver\MappingDriver;
use Doctrine\Persistence\Mapping\Driver\PHPDriver;
use LaravelDoctrine\ORM\Configuration\MetaData\Php;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class PhpTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Configuration/MetaData/SimplifiedXmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Doctrine\ORM\Mapping\Driver\SimplifiedXmlDriver;
use Doctrine\Persistence\Mapping\Driver\MappingDriver;
use LaravelDoctrine\ORM\Configuration\MetaData\SimplifiedXml;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class SimplifiedXmlTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Configuration/MetaData/StaticPhpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Doctrine\Persistence\Mapping\Driver\MappingDriver;
use Doctrine\Persistence\Mapping\Driver\StaticPHPDriver;
use LaravelDoctrine\ORM\Configuration\MetaData\StaticPhp;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class StaticPhpTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Configuration/MetaData/XmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Doctrine\ORM\Mapping\Driver\XmlDriver;
use Doctrine\Persistence\Mapping\Driver\MappingDriver;
use LaravelDoctrine\ORM\Configuration\MetaData\Xml;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class XmlTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/DoctrineManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
use LaravelDoctrine\ORM\DoctrineManager;
use LaravelDoctrine\ORM\EntityManagerFactory;
use LaravelDoctrine\ORM\Extensions\MappingDriverChain;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use PHPUnit\Framework\TestCase;

class DoctrineManagerTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/EntityManagerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
use LaravelDoctrineTest\ORM\Assets\FilterStub;
use LaravelDoctrineTest\ORM\Assets\ListenerStub;
use LaravelDoctrineTest\ORM\Assets\SubscriberStub;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;
use Psr\Cache\CacheItemPoolInterface;
use ReflectionException;
use ReflectionObject;
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Extensions/ExtensionManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
use LaravelDoctrineTest\ORM\Assets\Extensions\ExtensionMock;
use LaravelDoctrineTest\ORM\Assets\Extensions\ExtensionMock2;
use LaravelDoctrineTest\ORM\Assets\Extensions\ExtensionWithFiltersMock;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class ExtensionManagerTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Extensions/MappingDriverChainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use Doctrine\Persistence\Mapping\Driver\DefaultFileLocator;
use Doctrine\Persistence\Mapping\Driver\SymfonyFileLocator;
use LaravelDoctrine\ORM\Extensions\MappingDriverChain;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

/**
* NOTE: This test was degraded while refactoring for ORM 3.
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/IlluminateRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
use InvalidArgumentException;
use LaravelDoctrine\ORM\EntityManagerFactory;
use LaravelDoctrine\ORM\IlluminateRegistry;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;
use RuntimeException;
use stdClass;

Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Middleware/SubstituteBindingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
use LaravelDoctrine\ORM\Middleware\SubstituteBindings;
use LaravelDoctrineTest\ORM\Assets\Middleware\BindableEntity;
use LaravelDoctrineTest\ORM\Assets\Middleware\BindableEntityWithInterface;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class SubstituteBindingsTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Notifications/DoctrineChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
use LaravelDoctrineTest\ORM\Assets\Notifications\NotificationDatabaseStub;
use LaravelDoctrineTest\ORM\Assets\Notifications\NotificationInvalidStub;
use LaravelDoctrineTest\ORM\Assets\Notifications\NotificationStub;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;
use RuntimeException;

class DoctrineChannelTest extends TestCase
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Notifications/NotificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use Doctrine\ORM\EntityManagerInterface;
use LaravelDoctrine\ORM\Notifications\Notification;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;
use ReflectionClass;
use stdClass;

Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Pagination/PaginatorAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use Illuminate\Pagination\AbstractPaginator;
use LaravelDoctrine\ORM\Pagination\PaginatorAdapter;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery;
use PHPUnit\Framework\TestCase;
use stdClass;

class PaginatorAdapterTest extends TestCase
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Resolvers/EntityListenerResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Doctrine\ORM\Mapping\EntityListenerResolver as ResolverContract;
use Illuminate\Contracts\Container\Container;
use LaravelDoctrine\ORM\Resolvers\EntityListenerResolver;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use stdClass;
use TypeError;

Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Serializers/ArraySerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use LaravelDoctrine\ORM\Serializers\Arrayable;
use LaravelDoctrine\ORM\Serializers\ArraySerializer;
use PHPUnit\Framework\TestCase;
use LaravelDoctrineTest\ORM\TestCase;

class ArraySerializerTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Serializers/JsonSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use LaravelDoctrine\ORM\Serializers\Jsonable;
use LaravelDoctrine\ORM\Serializers\JsonSerializer;
use PHPUnit\Framework\TestCase;
use LaravelDoctrineTest\ORM\TestCase;

class JsonSerializerTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use Doctrine\ORM\EntityRepository;
use Illuminate\Contracts\Container\Container;
use LaravelDoctrine\ORM\Testing\Concerns\InteractsWithEntities;
use LaravelDoctrineTest\ORM\MockeryTestCase;
use Mockery;
use Mockery\Adapter\Phpunit\MockeryTestCase;
use PHPUnit\Framework\ExpectationFailedException;

class InteractsWithEntitiesTest extends MockeryTestCase
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Testing/FactoryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Doctrine\Persistence\ManagerRegistry;
use Faker;
use LaravelDoctrine\ORM\Testing\FactoryBuilder;
use Mockery\Adapter\Phpunit\MockeryTestCase;
use LaravelDoctrineTest\ORM\MockeryTestCase;

class FactoryBuilderTest extends MockeryTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Testing/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Doctrine\Persistence\ManagerRegistry;
use Faker;
use LaravelDoctrine\ORM\Testing\Factory;
use LaravelDoctrineTest\ORM\MockeryTestCase;
use Mockery;
use Mockery\Adapter\Phpunit\MockeryTestCase;

class FactoryTest extends MockeryTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Testing/SimpleHydratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use LaravelDoctrine\ORM\Testing\SimpleHydrator;
use LaravelDoctrineTest\ORM\Assets\Testing\AncestorHydrateableClass;
use LaravelDoctrineTest\ORM\Assets\Testing\ChildHydrateableClass;
use PHPUnit\Framework\TestCase;
use LaravelDoctrineTest\ORM\TestCase;

class SimpleHydratorTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Validation/DoctrinePresenceVerifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
use InvalidArgumentException;
use LaravelDoctrine\ORM\Validation\DoctrinePresenceVerifier;
use LaravelDoctrineTest\ORM\Assets\Mock\CountableEntityMock;
use LaravelDoctrineTest\ORM\TestCase;
use Mockery as m;
use Mockery\Mock;
use PHPUnit\Framework\TestCase;

class DoctrinePresenceVerifierTest extends TestCase
{
Expand Down
20 changes: 20 additions & 0 deletions tests/MockeryTestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace LaravelDoctrineTest\ORM;

use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
use Mockery\Adapter\Phpunit\MockeryTestCaseSetUp;

abstract class MockeryTestCase extends TestCase
{
use MockeryPHPUnitIntegration;
use MockeryTestCaseSetUp;

protected function mockeryTestSetUp()
{
}

protected function mockeryTestTearDown()
{
}
}
Loading

0 comments on commit 5c3b987

Please sign in to comment.