mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-03 06:54:34 +02:00
Improved code style of tests
This commit is contained in:
parent
5629215ce4
commit
684334ba22
73 changed files with 196 additions and 38 deletions
|
@ -36,6 +36,7 @@ use LogicException;
|
|||
|
||||
/**
|
||||
* Class Attachment.
|
||||
* @see \App\Tests\Entity\Attachments\AttachmentTest
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: AttachmentRepository::class)]
|
||||
#[ORM\InheritanceType('SINGLE_TABLE')]
|
||||
|
|
|
@ -34,6 +34,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
|
||||
/**
|
||||
* Class AttachmentType.
|
||||
* @see \App\Tests\Entity\Attachments\AttachmentTypeTest
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: StructuralDBElementRepository::class)]
|
||||
#[ORM\Table(name: '`attachment_types`')]
|
||||
|
|
|
@ -47,6 +47,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
|||
* an attribute of a root element, you will get an exception!
|
||||
*
|
||||
*
|
||||
* @see \App\Tests\Entity\Base\AbstractStructuralDBElementTest
|
||||
*/
|
||||
#[UniqueEntity(fields: ['name', 'parent'], ignoreNull: false, message: 'structural.entity.unique_name')]
|
||||
#[ORM\MappedSuperclass(repositoryClass: StructuralDBElementRepository::class)]
|
||||
|
|
|
@ -51,6 +51,7 @@ use App\Repository\LogEntryRepository;
|
|||
|
||||
/**
|
||||
* This entity describes an entry in the event log.
|
||||
* @see \App\Tests\Entity\LogSystem\AbstractLogEntryTest
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: LogEntryRepository::class)]
|
||||
#[ORM\Table('log')]
|
||||
|
|
|
@ -47,6 +47,9 @@ use App\Entity\Parts\Part;
|
|||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
/**
|
||||
* @see \App\Tests\Entity\Parameters\PartParameterTest
|
||||
*/
|
||||
#[UniqueEntity(fields: ['name', 'group', 'element'])]
|
||||
#[ORM\Entity(repositoryClass: ParameterRepository::class)]
|
||||
class PartParameter extends AbstractParameter
|
||||
|
|
|
@ -49,6 +49,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
|||
*
|
||||
* The class properties are split over various traits in directory PartTraits.
|
||||
* Otherwise, this class would be too big, to be maintained.
|
||||
* @see \App\Tests\Entity\Parts\PartTest
|
||||
*/
|
||||
#[UniqueEntity(fields: ['ipn'], message: 'part.ipn.must_be_unique')]
|
||||
#[ORM\Entity(repositoryClass: PartRepository::class)]
|
||||
|
|
|
@ -42,6 +42,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
|||
* It is the connection between a part and its store locations.
|
||||
*
|
||||
* @ValidPartLot()
|
||||
* @see \App\Tests\Entity\Parts\PartLotTest
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
|
|
|
@ -26,6 +26,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||
/**
|
||||
* This class is used to store the permissions of a user.
|
||||
* This has to be an embeddable or otherwise doctrine could not track the changes of the underlying data array (which is serialized to JSON in the database)
|
||||
* @see \App\Tests\Entity\UserSystem\PermissionDataTest
|
||||
*/
|
||||
#[ORM\Embeddable]
|
||||
final class PermissionData implements \JsonSerializable
|
||||
|
|
|
@ -57,6 +57,7 @@ use Jbtronics\TFAWebauthn\Model\TwoFactorInterface as WebauthnTwoFactorInterface
|
|||
/**
|
||||
* This entity represents a user, which can log in and have permissions.
|
||||
* Also, this entity is able to save some information about the user, like the names, email-address and other info.
|
||||
* @see \App\Tests\Entity\UserSystem\UserTest
|
||||
*/
|
||||
#[UniqueEntity('name', message: 'validator.user.username_already_used')]
|
||||
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue