Added some basic DB fields for the new project system

This commit is contained in:
Jan Böhmer 2022-12-18 20:34:25 +01:00
parent 8ae4e9fe05
commit 0c7ec9f0c7
36 changed files with 281 additions and 130 deletions

View file

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace App\Tests\Controller\AdminPages;
use App\Entity\Devices\Device;
use App\Entity\ProjectSystem\Project;
/**
* @group slow
@ -32,5 +32,5 @@ use App\Entity\Devices\Device;
class DeviceControllerTest extends AbstractAdminControllerTest
{
protected static $base_path = '/en'.'/device';
protected static $entity_class = Device::class;
protected static $entity_class = Project::class;
}

View file

@ -27,7 +27,7 @@ use App\Entity\Attachments\AttachmentType;
use App\Entity\Attachments\AttachmentTypeAttachment;
use App\Entity\Attachments\CategoryAttachment;
use App\Entity\Attachments\CurrencyAttachment;
use App\Entity\Attachments\DeviceAttachment;
use App\Entity\Attachments\ProjectAttachment;
use App\Entity\Attachments\FootprintAttachment;
use App\Entity\Attachments\GroupAttachment;
use App\Entity\Attachments\ManufacturerAttachment;
@ -36,7 +36,7 @@ use App\Entity\Attachments\PartAttachment;
use App\Entity\Attachments\StorelocationAttachment;
use App\Entity\Attachments\SupplierAttachment;
use App\Entity\Attachments\UserAttachment;
use App\Entity\Devices\Device;
use App\Entity\ProjectSystem\Project;
use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint;
use App\Entity\Parts\Manufacturer;
@ -78,7 +78,7 @@ class AttachmentTest extends TestCase
[AttachmentTypeAttachment::class, AttachmentType::class],
[CategoryAttachment::class, Category::class],
[CurrencyAttachment::class, Currency::class],
[DeviceAttachment::class, Device::class],
[ProjectAttachment::class, Project::class],
[FootprintAttachment::class, Footprint::class],
[GroupAttachment::class, Group::class],
[ManufacturerAttachment::class, Manufacturer::class],
@ -117,8 +117,8 @@ class AttachmentTest extends TestCase
/** @var Attachment $attachment */
$attachment = new $attachment_class();
if (Device::class !== $allowed_class) {
$element = new Device();
if (Project::class !== $allowed_class) {
$element = new Project();
} else {
$element = new Category();
}

View file

@ -44,8 +44,8 @@ namespace App\Tests\Entity\LogSystem;
use App\Entity\Attachments\Attachment;
use App\Entity\Attachments\AttachmentType;
use App\Entity\Attachments\PartAttachment;
use App\Entity\Devices\Device;
use App\Entity\Devices\DevicePart;
use App\Entity\ProjectSystem\Project;
use App\Entity\ProjectSystem\ProjectBOMEntry;
use App\Entity\LogSystem\AbstractLogEntry;
use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint;
@ -82,8 +82,8 @@ class AbstractLogEntryTest extends TestCase
[2, Attachment::class],
[3, AttachmentType::class],
[4, Category::class],
[5, Device::class],
[6, DevicePart::class],
[5, Project::class],
[6, ProjectBOMEntry::class],
[7, Footprint::class],
[8, Group::class],
[9, Manufacturer::class],

View file

@ -22,7 +22,7 @@ namespace App\Tests\Twig;
use App\Entity\Attachments\Attachment;
use App\Entity\Attachments\PartAttachment;
use App\Entity\Devices\Device;
use App\Entity\ProjectSystem\Project;
use App\Entity\LabelSystem\LabelProfile;
use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint;
@ -58,7 +58,7 @@ class EntityExtensionTest extends WebTestCase
$this->assertEquals('storelocation', $this->service->getEntityType(new Storelocation()));
$this->assertEquals('manufacturer', $this->service->getEntityType(new Manufacturer()));
$this->assertEquals('category', $this->service->getEntityType(new Category()));
$this->assertEquals('device', $this->service->getEntityType(new Device()));
$this->assertEquals('device', $this->service->getEntityType(new Project()));
$this->assertEquals('attachment', $this->service->getEntityType(new PartAttachment()));
$this->assertEquals('supplier', $this->service->getEntityType(new Supplier()));
$this->assertEquals('user', $this->service->getEntityType(new User()));