PHP 8 Compatibility

This commit is contained in:
Frédéric Guillot
2022-02-05 11:49:03 -08:00
committed by GitHub
parent 61e63ef9e0
commit f5bb55bdb8
558 changed files with 6262 additions and 21691 deletions

View File

@@ -10,7 +10,7 @@ class ActionProcedureTest extends BaseProcedureTest
{
$actions = $this->app->getAvailableActions();
$this->assertNotEmpty($actions);
$this->assertInternalType('array', $actions);
$this->assertIsArray($actions);
$this->assertArrayHasKey('\Kanboard\Action\TaskCloseColumn', $actions);
}
@@ -18,7 +18,7 @@ class ActionProcedureTest extends BaseProcedureTest
{
$events = $this->app->getAvailableActionEvents();
$this->assertNotEmpty($events);
$this->assertInternalType('array', $events);
$this->assertIsArray($events);
$this->assertArrayHasKey('task.move.column', $events);
}
@@ -26,7 +26,7 @@ class ActionProcedureTest extends BaseProcedureTest
{
$events = $this->app->getCompatibleActionEvents('\Kanboard\Action\TaskCloseColumn');
$this->assertNotEmpty($events);
$this->assertInternalType('array', $events);
$this->assertIsArray($events);
$this->assertArrayHasKey('task.move.column', $events);
}
@@ -49,7 +49,7 @@ class ActionProcedureTest extends BaseProcedureTest
{
$actions = $this->app->getActions($this->projectId);
$this->assertNotEmpty($actions);
$this->assertInternalType('array', $actions);
$this->assertIsArray($actions);
$this->assertArrayHasKey('id', $actions[0]);
$this->assertArrayHasKey('project_id', $actions[0]);
$this->assertArrayHasKey('event_name', $actions[0]);

View File

@@ -27,7 +27,7 @@ abstract class BaseProcedureTest extends PHPUnit\Framework\TestCase
protected $username = 'test-user';
protected $userId;
public function setUp()
protected function setUp(): void
{
$this->setUpAppClient();
$this->setUpAdminUser();

View File

@@ -40,7 +40,7 @@ class CategoryProcedureTest extends BaseProcedureTest
{
$category = $this->app->getCategory($this->categoryId);
$this->assertInternalType('array', $category);
$this->assertIsArray($category);
$this->assertEquals($this->categoryId, $category['id']);
$this->assertEquals('Category', $category['name']);
$this->assertEquals($this->projectId, $category['project_id']);

View File

@@ -43,11 +43,11 @@ class LinkProcedureTest extends BaseProcedureTest
{
$link_id = $this->app->createLink(array('label' => 'test'));
$this->assertNotFalse($link_id);
$this->assertInternalType('int', $link_id);
$this->assertIsInt($link_id);
$link_id = $this->app->createLink(array('label' => 'foo', 'opposite_label' => 'bar'));
$this->assertNotFalse($link_id);
$this->assertInternalType('int', $link_id);
$this->assertIsInt($link_id);
}
public function testUpdateLink()

View File

@@ -46,7 +46,7 @@ class ProjectProcedureTest extends BaseProcedureTest
{
$projects = $this->app->getAllProjects();
$this->assertNotEmpty($projects);
$this->assertInternalType('array', $projects);
$this->assertIsArray($projects);
$this->assertArrayHasKey('board', $projects[0]['url']);
$this->assertArrayHasKey('list', $projects[0]['url']);
}
@@ -54,14 +54,14 @@ class ProjectProcedureTest extends BaseProcedureTest
public function assertGetProjectActivity()
{
$activities = $this->app->getProjectActivity($this->projectId);
$this->assertInternalType('array', $activities);
$this->assertIsArray($activities);
$this->assertCount(0, $activities);
}
public function assertGetProjectsActivity()
{
$activities = $this->app->getProjectActivities(array('project_ids' => array($this->projectId)));
$this->assertInternalType('array', $activities);
$this->assertIsArray($activities);
$this->assertCount(0, $activities);
}

View File

@@ -31,7 +31,7 @@ class SwimlaneProcedureTest extends BaseProcedureTest
public function assertGetSwimlane()
{
$swimlane = $this->app->getSwimlane($this->swimlaneId);
$this->assertInternalType('array', $swimlane);
$this->assertIsArray($swimlane);
$this->assertEquals('Swimlane 1', $swimlane['name']);
}

View File

@@ -44,7 +44,7 @@ class TaskProcedureTest extends BaseProcedureTest
public function assertGetAllTasks()
{
$tasks = $this->app->getAllTasks($this->projectId);
$this->assertInternalType('array', $tasks);
$this->assertIsArray($tasks);
$this->assertNotEmpty($tasks);
$this->assertArrayHasKey('url', $tasks[0]);
}

View File

@@ -32,7 +32,7 @@ class UserProcedureTest extends BaseProcedureTest
public function assertGetAllUsers()
{
$users = $this->app->getAllUsers();
$this->assertInternalType('array', $users);
$this->assertIsArray($users);
$this->assertNotEmpty($users);
}