Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHP 8.2 deprecations in tests #150

Merged
merged 4 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .laminas-ci.json
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
{
"ignore_php_platform_requirements": {
"8.0": true,
"8.1": true,
"8.2": true
}
}
{}
12 changes: 5 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,18 @@
"laminas/laminas-eventmanager": "^3.4",
"laminas/laminas-http": "^2.15",
"laminas/laminas-modulemanager": "^2.8",
"laminas/laminas-router": "^3.5",
"laminas/laminas-servicemanager": "^3.7",
"laminas/laminas-router": "^3.11.1",
"laminas/laminas-servicemanager": "^3.20.0",
"laminas/laminas-stdlib": "^3.6",
"laminas/laminas-view": "^2.14"
},
"require-dev": {
"http-interop/http-middleware": "^0.4.1",
"laminas/laminas-coding-standard": "^2.4.0",
"laminas/laminas-json": "^3.3",
"laminas/laminas-psr7bridge": "^1.8",
"laminas/laminas-stratigility": ">=2.0.1 <2.2",
"phpspec/prophecy" : "^1.15.0",
"phpspec/prophecy": "^1.15.0",
"phpspec/prophecy-phpunit": "^2.0.1",
"phpunit/phpunit": "^9.5.25"
"phpunit/phpunit": "^9.5.25",
"webmozart/assert": "^1.11"
},
"suggest": {
"laminas/laminas-json": "(^2.6.1 || ^3.0) To auto-deserialize JSON body content in AbstractRestfulController extensions, when json_decode is unavailable",
Expand Down
1,030 changes: 270 additions & 760 deletions composer.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions test/Controller/ActionControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class ActionControllerTest extends TestCase
public $event;
public $request;
public $response;
private RouteMatch $routeMatch;
private SharedEventManager $sharedEvents;
private EventManager $events;

public function setUp(): void
{
Expand Down
5 changes: 5 additions & 0 deletions test/Controller/ControllerManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

class ControllerManagerTest extends TestCase
{
private SharedEventManager $sharedEvents;
private EventManager $events;
private ServiceManager $services;
private ControllerManager $controllers;

public function setUp(): void
{
$this->sharedEvents = new SharedEventManager;
Expand Down
3 changes: 3 additions & 0 deletions test/Controller/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

class IntegrationTest extends TestCase
{
private SharedEventManager $sharedEvents;
private ServiceManager $services;

public function setUp(): void
{
$this->sharedEvents = new SharedEventManager();
Expand Down
135 changes: 0 additions & 135 deletions test/Controller/MiddlewareControllerTest.php

This file was deleted.

6 changes: 6 additions & 0 deletions test/Controller/Plugin/AcceptableViewModelSelectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace LaminasTest\Mvc\Controller\Plugin;

use Laminas\Mvc\Controller\Plugin\AcceptableViewModelSelector;
use Laminas\View\Model\JsonModel;
use Laminas\View\Model\FeedModel;
use Laminas\View\Model\ViewModel;
Expand All @@ -16,6 +17,11 @@

class AcceptableViewModelSelectorTest extends TestCase
{
private Request $request;
private MvcEvent $event;
private SampleController $controller;
private AcceptableViewModelSelector $plugin;

public function setUp(): void
{
$this->request = new Request();
Expand Down
1 change: 1 addition & 0 deletions test/Controller/Plugin/ForwardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class ForwardTest extends TestCase
* @var Forward
*/
private $plugin;
private ServiceManager $services;

public function setUp(): void
{
Expand Down
4 changes: 4 additions & 0 deletions test/Controller/Plugin/LayoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

class LayoutTest extends TestCase
{
private MvcEvent $event;
private SampleController $controller;
private LayoutPlugin $plugin;

public function setUp(): void
{
$this->event = $event = new MvcEvent();
Expand Down
5 changes: 5 additions & 0 deletions test/Controller/Plugin/ParamsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@
use Laminas\Http\Header\GenericHeader;
use Laminas\Http\Request;
use Laminas\Http\Response;
use Laminas\Mvc\Controller\Plugin\Params;
use Laminas\Mvc\MvcEvent;
use Laminas\Router\RouteMatch;
use LaminasTest\Mvc\Controller\TestAsset\SampleController;
use PHPUnit\Framework\TestCase;

class ParamsTest extends TestCase
{
private Request $request;
private SampleController $controller;
private Params $plugin;

public function setUp(): void
{
$this->request = new Request;
Expand Down
7 changes: 7 additions & 0 deletions test/Controller/Plugin/RedirectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@

class RedirectTest extends TestCase
{
private Response $response;
private SimpleRouteStack $router;
private RouteMatch $routeMatch;
private MvcEvent $event;
private SampleController $controller;
private RedirectPlugin $plugin;

public function setUp(): void
{
$this->response = new Response();
Expand Down
4 changes: 4 additions & 0 deletions test/Controller/Plugin/UrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

class UrlTest extends TestCase
{
private SimpleRouteStack $router;
private SampleController $controller;
private UrlPlugin $plugin;

public function setUp(): void
{
$router = new SimpleRouteStack;
Expand Down
2 changes: 2 additions & 0 deletions test/Controller/RestfulControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class RestfulControllerTest extends TestCase
public $response;
public $routeMatch;
public $event;
private SharedEventManager $sharedEvents;
private EventManager $events;

public function setUp(): void
{
Expand Down
Loading