Skip to content

Commit

Permalink
Fix prophesize deprecated messages
Browse files Browse the repository at this point in the history
  • Loading branch information
snapshotpl committed Nov 3, 2020
1 parent 6ecf332 commit 29cb133
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -38,6 +38,7 @@
"laminas/laminas-json": "^2.6.1 || ^3.0",
"laminas/laminas-psr7bridge": "^1.0",
"laminas/laminas-stratigility": ">=2.0.1 <2.2",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.4.2"
},
"suggest": {
Expand Down
8 changes: 8 additions & 0 deletions test/Controller/LazyControllerAbstractFactoryTest.php
Expand Up @@ -13,9 +13,17 @@
use Laminas\ServiceManager\Exception\ServiceNotFoundException;
use Laminas\Validator\ValidatorPluginManager;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

class LazyControllerAbstractFactoryTest extends TestCase
{
use ProphecyTrait;

/**
* @var ContainerInterface|\Prophecy\Prophecy\ObjectProphecy
*/
private $container;

public function setUp(): void
{
$this->container = $this->prophesize(ContainerInterface::class);
Expand Down
3 changes: 3 additions & 0 deletions test/DispatchListenerTest.php
Expand Up @@ -20,9 +20,12 @@
use Laminas\Stdlib\ResponseInterface;
use Laminas\View\Model\ModelInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

class DispatchListenerTest extends TestCase
{
use ProphecyTrait;

public function createMvcEvent($controllerMatched)
{
$response = new Response();
Expand Down
3 changes: 3 additions & 0 deletions test/MiddlewareListenerTest.php
Expand Up @@ -26,11 +26,14 @@
use Laminas\Stdlib\DispatchableInterface;
use Laminas\View\Model\ModelInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

class MiddlewareListenerTest extends TestCase
{
use ProphecyTrait;

/**
* @var \Prophecy\Prophecy\ObjectProphecy
*/
Expand Down
3 changes: 3 additions & 0 deletions test/Service/HttpMethodListenerFactoryTest.php
Expand Up @@ -13,12 +13,15 @@
use Laminas\ServiceManager\ServiceLocatorInterface;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject as MockObject;
use Prophecy\PhpUnit\ProphecyTrait;

/**
* @covers Laminas\Mvc\Service\HttpMethodListenerFactory
*/
class HttpMethodListenerFactoryTest extends TestCase
{
use ProphecyTrait;

/**
* @var ServiceLocatorInterface|MockObject
*/
Expand Down
3 changes: 3 additions & 0 deletions test/Service/InjectTemplateListenerFactoryTest.php
Expand Up @@ -14,6 +14,7 @@
use Laminas\Mvc\View\Http\InjectTemplateListener;
use Laminas\ServiceManager\ServiceLocatorInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

/**
* Tests for {@see \Laminas\Mvc\Service\InjectTemplateListenerFactory}
Expand All @@ -22,6 +23,8 @@
*/
class InjectTemplateListenerFactoryTest extends TestCase
{
use ProphecyTrait;

public function testFactoryCanCreateInjectTemplateListener()
{
$this->buildInjectTemplateListenerWithConfig([]);
Expand Down
3 changes: 3 additions & 0 deletions test/Service/RequestFactoryTest.php
Expand Up @@ -12,9 +12,12 @@
use Laminas\Http\Request as HttpRequest;
use Laminas\Mvc\Service\RequestFactory;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

class RequestFactoryTest extends TestCase
{
use ProphecyTrait;

public function testFactoryCreatesHttpRequest()
{
$factory = new RequestFactory();
Expand Down
3 changes: 3 additions & 0 deletions test/Service/ResponseFactoryTest.php
Expand Up @@ -12,9 +12,12 @@
use Laminas\Http\Response as HttpResponse;
use Laminas\Mvc\Service\ResponseFactory;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

class ResponseFactoryTest extends TestCase
{
use ProphecyTrait;

public function testFactoryCreatesHttpResponse()
{
$factory = new ResponseFactory();
Expand Down
3 changes: 3 additions & 0 deletions test/Service/SendResponseListenerFactoryTest.php
Expand Up @@ -19,9 +19,12 @@
use Laminas\Mvc\Service\SendResponseListenerFactory;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;

class SendResponseListenerFactoryTest extends TestCase
{
use ProphecyTrait;

public function testFactoryReturnsListenerWithEventManagerFromContainer()
{
$sharedEvents = $this->prophesize(SharedEventManagerInterface::class);
Expand Down
3 changes: 3 additions & 0 deletions test/Service/ViewFeedStrategyFactoryTest.php
Expand Up @@ -13,9 +13,12 @@
use Laminas\View\Renderer\FeedRenderer;
use Laminas\View\Strategy\FeedStrategy;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

class ViewFeedStrategyFactoryTest extends TestCase
{
use ProphecyTrait;

private function createContainer()
{
$renderer = $this->prophesize(FeedRenderer::class);
Expand Down
3 changes: 3 additions & 0 deletions test/Service/ViewJsonStrategyFactoryTest.php
Expand Up @@ -13,9 +13,12 @@
use Laminas\View\Renderer\JsonRenderer;
use Laminas\View\Strategy\JsonStrategy;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

class ViewJsonStrategyFactoryTest extends TestCase
{
use ProphecyTrait;

private function createContainer()
{
$renderer = $this->prophesize(JsonRenderer::class);
Expand Down
3 changes: 3 additions & 0 deletions test/Service/ViewManagerFactoryTest.php
Expand Up @@ -12,9 +12,12 @@
use Laminas\Mvc\Service\ViewManagerFactory;
use Laminas\Mvc\View\Http\ViewManager as HttpViewManager;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

class ViewManagerFactoryTest extends TestCase
{
use ProphecyTrait;

private function createContainer()
{
$http = $this->prophesize(HttpViewManager::class);
Expand Down
3 changes: 3 additions & 0 deletions test/Service/ViewPrefixPathStackResolverFactoryTest.php
Expand Up @@ -13,9 +13,12 @@
use Laminas\ServiceManager\ServiceLocatorInterface;
use Laminas\View\Resolver\PrefixPathStackResolver;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

class ViewPrefixPathStackResolverFactoryTest extends TestCase
{
use ProphecyTrait;

public function testCreateService()
{
$serviceLocator = $this->prophesize(ServiceLocatorInterface::class);
Expand Down

0 comments on commit 29cb133

Please sign in to comment.