forked from mirror/Part-DB.Part-DB-server
Allow to restrict the file extensions for a attachment type.
This commit is contained in:
parent
2187f5eac2
commit
fdfb099cb5
25 changed files with 714 additions and 4 deletions
|
@ -38,6 +38,10 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
/**
|
||||
* @group slow
|
||||
* @package App\Tests\Controller\AdminPages
|
||||
*/
|
||||
abstract class AbstractAdminControllerTest extends WebTestCase
|
||||
{
|
||||
protected static $base_path = 'not_valid';
|
||||
|
@ -62,6 +66,7 @@ abstract class AbstractAdminControllerTest extends WebTestCase
|
|||
|
||||
/**
|
||||
* @dataProvider readDataProvider
|
||||
* @group slow
|
||||
* Tests if you can access the /new part which is used to list all entities. Checks if permissions are working
|
||||
*/
|
||||
public function testListEntries(string $user, bool $read)
|
||||
|
@ -81,6 +86,7 @@ abstract class AbstractAdminControllerTest extends WebTestCase
|
|||
|
||||
/**
|
||||
* @dataProvider readDataProvider
|
||||
* @group slow
|
||||
* Tests if it possible to access an specific entity. Checks if permissions are working.
|
||||
*/
|
||||
public function testReadEntity(string $user, bool $read)
|
||||
|
@ -110,6 +116,7 @@ abstract class AbstractAdminControllerTest extends WebTestCase
|
|||
|
||||
/**
|
||||
* Tests if deleting an entity is working.
|
||||
* @group slow
|
||||
* @dataProvider deleteDataProvider
|
||||
*/
|
||||
public function testDeleteEntity(string $user, bool $delete)
|
||||
|
|
|
@ -34,6 +34,10 @@ namespace App\Tests\Controller\AdminPages;
|
|||
|
||||
use App\Entity\Attachments\AttachmentType;
|
||||
|
||||
/**
|
||||
* @group slow
|
||||
* @package App\Tests\Controller\AdminPages
|
||||
*/
|
||||
class AttachmentTypeControllerTest extends AbstractAdminControllerTest
|
||||
{
|
||||
protected static $base_path = '/en' . '/attachment_type';
|
||||
|
|
|
@ -33,6 +33,10 @@ namespace App\Tests\Controller\AdminPages;
|
|||
|
||||
use App\Entity\Parts\Category;
|
||||
|
||||
/**
|
||||
* @group slow
|
||||
* @package App\Tests\Controller\AdminPages
|
||||
*/
|
||||
class CategoryControllerTest extends AbstractAdminControllerTest
|
||||
{
|
||||
protected static $base_path = '/en' . '/category';
|
||||
|
|
|
@ -35,6 +35,10 @@ namespace App\Tests\Controller\AdminPages;
|
|||
use App\Entity\Attachments\AttachmentType;
|
||||
use App\Entity\Devices\Device;
|
||||
|
||||
/**
|
||||
* @group slow
|
||||
* @package App\Tests\Controller\AdminPages
|
||||
*/
|
||||
class DeviceControllerTest extends AbstractAdminControllerTest
|
||||
{
|
||||
protected static $base_path = '/en' . '/device';
|
||||
|
|
|
@ -35,6 +35,10 @@ namespace App\Tests\Controller\AdminPages;
|
|||
use App\Entity\Attachments\AttachmentType;
|
||||
use App\Entity\Parts\Footprint;
|
||||
|
||||
/**
|
||||
* @group slow
|
||||
* @package App\Tests\Controller\AdminPages
|
||||
*/
|
||||
class FootprintControllerTest extends AbstractAdminControllerTest
|
||||
{
|
||||
protected static $base_path = '/en' . '/footprint';
|
||||
|
|
|
@ -36,6 +36,10 @@ use App\Entity\Attachments\AttachmentType;
|
|||
use App\Entity\Devices\Device;
|
||||
use App\Entity\Parts\Manufacturer;
|
||||
|
||||
/**
|
||||
* @group slow
|
||||
* @package App\Tests\Controller\AdminPages
|
||||
*/
|
||||
class ManufacturerControllerTest extends AbstractAdminControllerTest
|
||||
{
|
||||
protected static $base_path = '/en' . '/manufacturer';
|
||||
|
|
|
@ -37,6 +37,10 @@ use App\Entity\Devices\Device;
|
|||
use App\Entity\Parts\Manufacturer;
|
||||
use App\Entity\Parts\MeasurementUnit;
|
||||
|
||||
/**
|
||||
* @group slow
|
||||
* @package App\Tests\Controller\AdminPages
|
||||
*/
|
||||
class MeasurementUnitControllerTest extends AbstractAdminControllerTest
|
||||
{
|
||||
protected static $base_path = '/en' . '/measurement_unit';
|
||||
|
|
|
@ -38,6 +38,10 @@ use App\Entity\Parts\Manufacturer;
|
|||
use App\Entity\Parts\Storelocation;
|
||||
use Symfony\Component\HttpKernel\HttpCache\Store;
|
||||
|
||||
/**
|
||||
* @group slow
|
||||
* @package App\Tests\Controller\AdminPages
|
||||
*/
|
||||
class StorelocationControllerTest extends AbstractAdminControllerTest
|
||||
{
|
||||
protected static $base_path = '/en' . '/store_location';
|
||||
|
|
|
@ -37,6 +37,10 @@ use App\Entity\Devices\Device;
|
|||
use App\Entity\Parts\Manufacturer;
|
||||
use App\Entity\Parts\Supplier;
|
||||
|
||||
/**
|
||||
* @group slow
|
||||
* @package App\Tests\Controller\AdminPages
|
||||
*/
|
||||
class SupplierControllerTest extends AbstractAdminControllerTest
|
||||
{
|
||||
protected static $base_path = '/en' . '/supplier';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue