Adapt Unit Tests code to PHPUnit 6

This commit is contained in:
Fabri Di Napoli 2017-03-09 00:35:08 +01:00
parent 16856fe6b6
commit 5df6eec070
37 changed files with 73 additions and 37 deletions

View File

@ -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

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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'];

View File

@ -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()
{

View File

@ -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()
{