Skip to content

Commit

Permalink
Adapt Unit Tests code to PHPUnit 6
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyunk3l committed Mar 8, 2017
1 parent 16856fe commit 5df6eec
Show file tree
Hide file tree
Showing 37 changed files with 73 additions and 37 deletions.
3 changes: 2 additions & 1 deletion Behavioral/ChainOfResponsibilities/Tests/ChainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
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
Expand Down
3 changes: 2 additions & 1 deletion Behavioral/Command/Tests/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
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()
{
Expand Down
3 changes: 2 additions & 1 deletion Behavioral/Command/Tests/UndoableCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
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()
{
Expand Down
3 changes: 2 additions & 1 deletion Behavioral/Iterator/Tests/IteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
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()
{
Expand Down
3 changes: 2 additions & 1 deletion Behavioral/Mediator/Tests/MediatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
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()
{
Expand Down
3 changes: 2 additions & 1 deletion Behavioral/Memento/Tests/MementoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

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()
{
Expand Down
3 changes: 2 additions & 1 deletion Behavioral/NullObject/Tests/LoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
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()
{
Expand Down
3 changes: 2 additions & 1 deletion Behavioral/Observer/Tests/ObserverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

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()
{
Expand Down
3 changes: 2 additions & 1 deletion Behavioral/Specification/Tests/SpecificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
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()
{
Expand Down
3 changes: 2 additions & 1 deletion Behavioral/State/Tests/StateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion Behavioral/Strategy/Tests/StrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
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()
{
Expand Down
3 changes: 2 additions & 1 deletion Behavioral/TemplateMethod/Tests/JourneyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion Behavioral/Visitor/Tests/VisitorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Creational/AbstractFactory/Tests/AbstractFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

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()
{
Expand Down
3 changes: 2 additions & 1 deletion Creational/Builder/Tests/DirectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
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()
{
Expand Down
3 changes: 2 additions & 1 deletion Creational/FactoryMethod/Tests/FactoryMethodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
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()
{
Expand Down
3 changes: 2 additions & 1 deletion Creational/Multiton/Tests/MultitonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion Creational/Pool/Tests/PoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion Creational/Prototype/Tests/PrototypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

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()
{
Expand Down
3 changes: 2 additions & 1 deletion Creational/SimpleFactory/Tests/SimpleFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion Creational/Singleton/Tests/SingletonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion Creational/StaticFactory/Tests/StaticFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion More/Delegation/Tests/DelegationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion More/EAV/Tests/EAVTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
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()
{
Expand Down
3 changes: 2 additions & 1 deletion More/Repository/Tests/RepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
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()
{
Expand Down
2 changes: 1 addition & 1 deletion More/ServiceLocator/Tests/ServiceLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use DesignPatterns\More\ServiceLocator\LogService;
use DesignPatterns\More\ServiceLocator\ServiceLocator;
use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;

class ServiceLocatorTest extends TestCase
{
Expand Down
3 changes: 2 additions & 1 deletion Structural/Adapter/Tests/AdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
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()
{
Expand Down
3 changes: 2 additions & 1 deletion Structural/Bridge/Tests/BridgeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
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()
{
Expand Down
3 changes: 2 additions & 1 deletion Structural/Composite/Tests/CompositeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion Structural/DataMapper/Tests/DataMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

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()
{
Expand Down
3 changes: 2 additions & 1 deletion Structural/Decorator/Tests/DecoratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

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()
{
Expand Down
3 changes: 2 additions & 1 deletion Structural/Facade/Tests/FacadeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

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()
{
Expand Down
3 changes: 2 additions & 1 deletion Structural/FluentInterface/Tests/FluentInterfaceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
3 changes: 2 additions & 1 deletion Structural/Flyweight/Tests/FlyweightTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
3 changes: 2 additions & 1 deletion Structural/Proxy/Tests/ProxyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

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()
{
Expand Down
Loading

0 comments on commit 5df6eec

Please sign in to comment.