forked from mirror/Part-DB.Part-DB-server
Applied code style to tests/
This commit is contained in:
parent
f861de791f
commit
fe0f69f762
44 changed files with 427 additions and 306 deletions
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
|
||||
*
|
||||
|
@ -38,7 +41,7 @@ class PermissionResolverTest extends WebTestCase
|
|||
protected $user_withoutGroup;
|
||||
protected $group;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
|
||||
|
@ -119,7 +122,7 @@ class PermissionResolverTest extends WebTestCase
|
|||
/**
|
||||
* @dataProvider getPermissionNames
|
||||
*/
|
||||
public function testListOperationsForPermission($perm_name)
|
||||
public function testListOperationsForPermission($perm_name): void
|
||||
{
|
||||
$arr = $this->service->listOperationsForPermission($perm_name);
|
||||
|
||||
|
@ -127,20 +130,20 @@ class PermissionResolverTest extends WebTestCase
|
|||
$this->assertNotEmpty($arr);
|
||||
}
|
||||
|
||||
public function testInvalidListOperationsForPermission()
|
||||
public function testInvalidListOperationsForPermission(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
//Must throw an exception
|
||||
$this->service->listOperationsForPermission('invalid');
|
||||
}
|
||||
|
||||
public function testisValidPermission()
|
||||
public function testisValidPermission(): void
|
||||
{
|
||||
$this->assertTrue($this->service->isValidPermission('parts'));
|
||||
$this->assertFalse($this->service->isValidPermission('invalid'));
|
||||
}
|
||||
|
||||
public function testIsValidOperation()
|
||||
public function testIsValidOperation(): void
|
||||
{
|
||||
$this->assertTrue($this->service->isValidOperation('parts', 'read'));
|
||||
|
||||
|
@ -150,7 +153,7 @@ class PermissionResolverTest extends WebTestCase
|
|||
$this->assertFalse($this->service->isValidOperation('invalid', 'invalid'));
|
||||
}
|
||||
|
||||
public function testDontInherit()
|
||||
public function testDontInherit(): void
|
||||
{
|
||||
//Check with faked object
|
||||
$this->assertTrue($this->service->dontInherit($this->user, 'parts', 'read'));
|
||||
|
@ -167,7 +170,7 @@ class PermissionResolverTest extends WebTestCase
|
|||
$this->assertNull($this->service->dontInherit($this->user_withoutGroup, 'parts', 'delete'));
|
||||
}
|
||||
|
||||
public function testInherit()
|
||||
public function testInherit(): void
|
||||
{
|
||||
//Not inherited values should be same as dont inherit:
|
||||
$this->assertTrue($this->service->inherit($this->user, 'parts', 'read'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue