mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-01-18 05:58:16 +01:00
Adapt Unit Tests code to PHPUnit 6
This commit is contained in:
parent
16856fe6b6
commit
5df6eec070
@ -5,8 +5,9 @@ namespace DesignPatterns\Behavioral\ChainOfResponsibilities\Tests;
|
||||
use DesignPatterns\Behavioral\ChainOfResponsibilities\Handler;
|
||||
use DesignPatterns\Behavioral\ChainOfResponsibilities\Responsible\HttpInMemoryCacheHandler;
|
||||
use DesignPatterns\Behavioral\ChainOfResponsibilities\Responsible\SlowDatabaseHandler;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ChainTest extends \PHPUnit_Framework_TestCase
|
||||
class ChainTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var Handler
|
||||
|
@ -5,8 +5,9 @@ namespace DesignPatterns\Behavioral\Command\Tests;
|
||||
use DesignPatterns\Behavioral\Command\HelloCommand;
|
||||
use DesignPatterns\Behavioral\Command\Invoker;
|
||||
use DesignPatterns\Behavioral\Command\Receiver;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class CommandTest extends \PHPUnit_Framework_TestCase
|
||||
class CommandTest extends TestCase
|
||||
{
|
||||
public function testInvocation()
|
||||
{
|
||||
|
@ -6,8 +6,9 @@ use DesignPatterns\Behavioral\Command\AddMessageDateCommand;
|
||||
use DesignPatterns\Behavioral\Command\HelloCommand;
|
||||
use DesignPatterns\Behavioral\Command\Invoker;
|
||||
use DesignPatterns\Behavioral\Command\Receiver;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class UndoableCommandTest extends \PHPUnit_Framework_TestCase
|
||||
class UndoableCommandTest extends TestCase
|
||||
{
|
||||
public function testInvocation()
|
||||
{
|
||||
|
@ -6,8 +6,9 @@ use DesignPatterns\Behavioral\Iterator\Book;
|
||||
use DesignPatterns\Behavioral\Iterator\BookList;
|
||||
use DesignPatterns\Behavioral\Iterator\BookListIterator;
|
||||
use DesignPatterns\Behavioral\Iterator\BookListReverseIterator;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class IteratorTest extends \PHPUnit_Framework_TestCase
|
||||
class IteratorTest extends TestCase
|
||||
{
|
||||
public function testCanIterateOverBookList()
|
||||
{
|
||||
|
@ -6,8 +6,9 @@ use DesignPatterns\Behavioral\Mediator\Mediator;
|
||||
use DesignPatterns\Behavioral\Mediator\Subsystem\Client;
|
||||
use DesignPatterns\Behavioral\Mediator\Subsystem\Database;
|
||||
use DesignPatterns\Behavioral\Mediator\Subsystem\Server;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class MediatorTest extends \PHPUnit_Framework_TestCase
|
||||
class MediatorTest extends TestCase
|
||||
{
|
||||
public function testOutputHelloWorld()
|
||||
{
|
||||
|
@ -4,8 +4,9 @@ namespace DesignPatterns\Behavioral\Memento\Tests;
|
||||
|
||||
use DesignPatterns\Behavioral\Memento\State;
|
||||
use DesignPatterns\Behavioral\Memento\Ticket;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class MementoTest extends \PHPUnit_Framework_TestCase
|
||||
class MementoTest extends TestCase
|
||||
{
|
||||
public function testOpenTicketAssignAndSetBackToOpen()
|
||||
{
|
||||
|
@ -5,8 +5,9 @@ namespace DesignPatterns\Behavioral\NullObject\Tests;
|
||||
use DesignPatterns\Behavioral\NullObject\NullLogger;
|
||||
use DesignPatterns\Behavioral\NullObject\PrintLogger;
|
||||
use DesignPatterns\Behavioral\NullObject\Service;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class LoggerTest extends \PHPUnit_Framework_TestCase
|
||||
class LoggerTest extends TestCase
|
||||
{
|
||||
public function testNullObject()
|
||||
{
|
||||
|
@ -4,8 +4,9 @@ namespace DesignPatterns\Behavioral\Observer\Tests;
|
||||
|
||||
use DesignPatterns\Behavioral\Observer\User;
|
||||
use DesignPatterns\Behavioral\Observer\UserObserver;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ObserverTest extends \PHPUnit_Framework_TestCase
|
||||
class ObserverTest extends TestCase
|
||||
{
|
||||
public function testChangeInUserLeadsToUserObserverBeingNotified()
|
||||
{
|
||||
|
@ -7,8 +7,9 @@ use DesignPatterns\Behavioral\Specification\NotSpecification;
|
||||
use DesignPatterns\Behavioral\Specification\OrSpecification;
|
||||
use DesignPatterns\Behavioral\Specification\AndSpecification;
|
||||
use DesignPatterns\Behavioral\Specification\PriceSpecification;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SpecificationTest extends \PHPUnit_Framework_TestCase
|
||||
class SpecificationTest extends TestCase
|
||||
{
|
||||
public function testCanOr()
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
namespace DesignPatterns\Behavioral\State\Tests;
|
||||
|
||||
use DesignPatterns\Behavioral\State\OrderRepository;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class StateTest extends \PHPUnit_Framework_TestCase
|
||||
class StateTest extends TestCase
|
||||
{
|
||||
public function testCanShipCreatedOrder()
|
||||
{
|
||||
|
@ -5,8 +5,9 @@ namespace DesignPatterns\Behavioral\Strategy\Tests;
|
||||
use DesignPatterns\Behavioral\Strategy\DateComparator;
|
||||
use DesignPatterns\Behavioral\Strategy\IdComparator;
|
||||
use DesignPatterns\Behavioral\Strategy\ObjectCollection;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class StrategyTest extends \PHPUnit_Framework_TestCase
|
||||
class StrategyTest extends TestCase
|
||||
{
|
||||
public function provideIntegers()
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
namespace DesignPatterns\Behavioral\TemplateMethod\Tests;
|
||||
|
||||
use DesignPatterns\Behavioral\TemplateMethod;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class JourneyTest extends \PHPUnit_Framework_TestCase
|
||||
class JourneyTest extends TestCase
|
||||
{
|
||||
public function testCanGetOnVacationOnTheBeach()
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
namespace DesignPatterns\Tests\Visitor\Tests;
|
||||
|
||||
use DesignPatterns\Behavioral\Visitor;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class VisitorTest extends \PHPUnit_Framework_TestCase
|
||||
class VisitorTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var Visitor\RoleVisitor
|
||||
|
@ -4,8 +4,9 @@ namespace DesignPatterns\Creational\AbstractFactory\Tests;
|
||||
|
||||
use DesignPatterns\Creational\AbstractFactory\HtmlFactory;
|
||||
use DesignPatterns\Creational\AbstractFactory\JsonFactory;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class AbstractFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
class AbstractFactoryTest extends TestCase
|
||||
{
|
||||
public function testCanCreateHtmlText()
|
||||
{
|
||||
|
@ -5,8 +5,9 @@ namespace DesignPatterns\Creational\Builder\Tests;
|
||||
use DesignPatterns\Creational\Builder\TruckBuilder;
|
||||
use DesignPatterns\Creational\Builder\CarBuilder;
|
||||
use DesignPatterns\Creational\Builder\Director;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class DirectorTest extends \PHPUnit_Framework_TestCase
|
||||
class DirectorTest extends TestCase
|
||||
{
|
||||
public function testCanBuildTruck()
|
||||
{
|
||||
|
@ -5,8 +5,9 @@ namespace DesignPatterns\Creational\FactoryMethod\Tests;
|
||||
use DesignPatterns\Creational\FactoryMethod\FactoryMethod;
|
||||
use DesignPatterns\Creational\FactoryMethod\GermanFactory;
|
||||
use DesignPatterns\Creational\FactoryMethod\ItalianFactory;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class FactoryMethodTest extends \PHPUnit_Framework_TestCase
|
||||
class FactoryMethodTest extends TestCase
|
||||
{
|
||||
public function testCanCreateCheapVehicleInGermany()
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
namespace DesignPatterns\Creational\Multition\Tests;
|
||||
|
||||
use DesignPatterns\Creational\Multiton\Multiton;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class MultitonTest extends \PHPUnit_Framework_TestCase
|
||||
class MultitonTest extends TestCase
|
||||
{
|
||||
public function testUniqueness()
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
namespace DesignPatterns\Creational\Pool\Tests;
|
||||
|
||||
use DesignPatterns\Creational\Pool\WorkerPool;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class PoolTest extends \PHPUnit_Framework_TestCase
|
||||
class PoolTest extends TestCase
|
||||
{
|
||||
public function testCanGetNewInstancesWithGet()
|
||||
{
|
||||
|
@ -4,8 +4,9 @@ namespace DesignPatterns\Creational\Prototype\Tests;
|
||||
|
||||
use DesignPatterns\Creational\Prototype\BarBookPrototype;
|
||||
use DesignPatterns\Creational\Prototype\FooBookPrototype;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class PrototypeTest extends \PHPUnit_Framework_TestCase
|
||||
class PrototypeTest extends TestCase
|
||||
{
|
||||
public function testCanGetFooBook()
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
namespace DesignPatterns\Creational\SimpleFactory\Tests;
|
||||
|
||||
use DesignPatterns\Creational\SimpleFactory\SimpleFactory;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SimpleFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
class SimpleFactoryTest extends TestCase
|
||||
{
|
||||
public function testCanCreateBicycle()
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
namespace DesignPatterns\Creational\Singleton\Tests;
|
||||
|
||||
use DesignPatterns\Creational\Singleton\Singleton;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SingletonTest extends \PHPUnit_Framework_TestCase
|
||||
class SingletonTest extends TestCase
|
||||
{
|
||||
public function testUniqueness()
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
namespace DesignPatterns\Creational\StaticFactory\Tests;
|
||||
|
||||
use DesignPatterns\Creational\StaticFactory\StaticFactory;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class StaticFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
class StaticFactoryTest extends TestCase
|
||||
{
|
||||
public function testCanCreateNumberFormatter()
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
namespace DesignPatterns\More\Delegation\Tests;
|
||||
|
||||
use DesignPatterns\More\Delegation;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class DelegationTest extends \PHPUnit_Framework_TestCase
|
||||
class DelegationTest extends TestCase
|
||||
{
|
||||
public function testHowTeamLeadWriteCode()
|
||||
{
|
||||
|
@ -5,8 +5,9 @@ namespace DesignPatterns\More\EAV\Tests;
|
||||
use DesignPatterns\More\EAV\Attribute;
|
||||
use DesignPatterns\More\EAV\Entity;
|
||||
use DesignPatterns\More\EAV\Value;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class EAVTest extends \PHPUnit_Framework_TestCase
|
||||
class EAVTest extends TestCase
|
||||
{
|
||||
public function testCanAddAttributeToEntity()
|
||||
{
|
||||
|
@ -5,8 +5,9 @@ namespace DesignPatterns\More\Repository\Tests;
|
||||
use DesignPatterns\More\Repository\MemoryStorage;
|
||||
use DesignPatterns\More\Repository\Post;
|
||||
use DesignPatterns\More\Repository\PostRepository;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class Repository extends \PHPUnit_Framework_TestCase
|
||||
class Repository extends TestCase
|
||||
{
|
||||
public function testCanPersistAndFindPost()
|
||||
{
|
||||
|
@ -4,7 +4,7 @@ namespace DesignPatterns\More\ServiceLocator\Tests;
|
||||
|
||||
use DesignPatterns\More\ServiceLocator\LogService;
|
||||
use DesignPatterns\More\ServiceLocator\ServiceLocator;
|
||||
use PHPUnit_Framework_TestCase as TestCase;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ServiceLocatorTest extends TestCase
|
||||
{
|
||||
|
@ -5,8 +5,9 @@ namespace DesignPatterns\Structural\Adapter\Tests;
|
||||
use DesignPatterns\Structural\Adapter\Book;
|
||||
use DesignPatterns\Structural\Adapter\EBookAdapter;
|
||||
use DesignPatterns\Structural\Adapter\Kindle;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class AdapterTest extends \PHPUnit_Framework_TestCase
|
||||
class AdapterTest extends TestCase
|
||||
{
|
||||
public function testCanTurnPageOnBook()
|
||||
{
|
||||
|
@ -5,8 +5,9 @@ namespace DesignPatterns\Structural\Bridge\Tests;
|
||||
use DesignPatterns\Structural\Bridge\HelloWorldService;
|
||||
use DesignPatterns\Structural\Bridge\HtmlFormatter;
|
||||
use DesignPatterns\Structural\Bridge\PlainTextFormatter;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class BridgeTest extends \PHPUnit_Framework_TestCase
|
||||
class BridgeTest extends TestCase
|
||||
{
|
||||
public function testCanPrintUsingThePlainTextPrinter()
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
namespace DesignPatterns\Structural\Composite\Tests;
|
||||
|
||||
use DesignPatterns\Structural\Composite;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class CompositeTest extends \PHPUnit_Framework_TestCase
|
||||
class CompositeTest extends TestCase
|
||||
{
|
||||
public function testRender()
|
||||
{
|
||||
|
@ -4,8 +4,9 @@ namespace DesignPatterns\Structural\DataMapper\Tests;
|
||||
|
||||
use DesignPatterns\Structural\DataMapper\StorageAdapter;
|
||||
use DesignPatterns\Structural\DataMapper\UserMapper;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class DataMapperTest extends \PHPUnit_Framework_TestCase
|
||||
class DataMapperTest extends TestCase
|
||||
{
|
||||
public function testCanMapUserFromStorage()
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
namespace DesignPatterns\Structural\Decorator\Tests;
|
||||
|
||||
use DesignPatterns\Structural\Decorator;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class DecoratorTest extends \PHPUnit_Framework_TestCase
|
||||
class DecoratorTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var Decorator\Webservice
|
||||
|
@ -4,8 +4,9 @@ namespace DesignPatterns\Structural\DependencyInjection\Tests;
|
||||
|
||||
use DesignPatterns\Structural\DependencyInjection\DatabaseConfiguration;
|
||||
use DesignPatterns\Structural\DependencyInjection\DatabaseConnection;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class DependencyInjectionTest extends \PHPUnit_Framework_TestCase
|
||||
class DependencyInjectionTest extends TestCase
|
||||
{
|
||||
public function testDependencyInjection()
|
||||
{
|
||||
|
@ -4,8 +4,9 @@ namespace DesignPatterns\Structural\Facade\Tests;
|
||||
|
||||
use DesignPatterns\Structural\Facade\Facade;
|
||||
use DesignPatterns\Structural\Facade\OsInterface;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class FacadeTest extends \PHPUnit_Framework_TestCase
|
||||
class FacadeTest extends TestCase
|
||||
{
|
||||
public function testComputerOn()
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
namespace DesignPatterns\Structural\FluentInterface\Tests;
|
||||
|
||||
use DesignPatterns\Structural\FluentInterface\Sql;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class FluentInterfaceTest extends \PHPUnit_Framework_TestCase
|
||||
class FluentInterfaceTest extends TestCase
|
||||
{
|
||||
public function testBuildSQL()
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
namespace DesignPatterns\Structural\Flyweight\Tests;
|
||||
|
||||
use DesignPatterns\Structural\Flyweight\FlyweightFactory;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class FlyweightTest extends \PHPUnit_Framework_TestCase
|
||||
class FlyweightTest extends TestCase
|
||||
{
|
||||
private $characters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
|
||||
'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
|
||||
|
@ -4,8 +4,9 @@ namespace DesignPatterns\Structural\Proxy\Tests;
|
||||
|
||||
use DesignPatterns\Structural\Decorator;
|
||||
use DesignPatterns\Structural\Proxy\RecordProxy;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ProxyTest extends \PHPUnit_Framework_TestCase
|
||||
class ProxyTest extends TestCase
|
||||
{
|
||||
public function testWillSetDirtyFlagInProxy()
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
namespace DesignPatterns\Structural\Registry\Tests;
|
||||
|
||||
use DesignPatterns\Structural\Registry\Registry;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class RegistryTest extends \PHPUnit_Framework_TestCase
|
||||
class RegistryTest extends TestCase
|
||||
{
|
||||
public function testSetAndGetLogger()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user