| @@ -11,6 +11,7 @@ additional_fqdns: [] | |||||
| database: | database: | ||||
| type: mariadb | type: mariadb | ||||
| version: "10.4" | version: "10.4" | ||||
| webimage_extra_packages: [php8.2-xdebug] | |||||
| use_dns_when_possible: true | use_dns_when_possible: true | ||||
| composer_version: "2" | composer_version: "2" | ||||
| web_environment: [] | web_environment: [] | ||||
| @@ -0,0 +1,15 @@ | |||||
| # For docker-toolbox users; Docker has not yet supported the "host.docker.internal" | |||||
| # convention that is used from ddev v0.18.0. But if you add this file as | |||||
| # .ddev/docker-compose.xdebug.yaml it should sort that out. | |||||
| # Note that the IP address in your environment might not be 192.168.99.1, | |||||
| # Find out what address to use with "docker-machine ip default" | |||||
| # It will probably give 192.168.99.100. | |||||
| # Replace the last digit of the ip with "1", so 192.168.99.100 becomes 192.168.99.1 | |||||
| version: "3.6" | |||||
| services: | |||||
| web: | |||||
| extra_hosts: | |||||
| - "host.docker.internal:192.168.65.254" | |||||
| # Find out what address to use with "docker-machine ip default" | |||||
| # It will probably give 192.168.99.100. | |||||
| # Replace the last digit of the ip with "1", so 192.168.99.100 becomes 192.168.99.1 | |||||
| @@ -0,0 +1,4 @@ | |||||
| xdebug.mode=debug | |||||
| xdebug.start_with_request=yes | |||||
| xdebug.output_dir=/var/www/html/.ddev/xdebug | |||||
| xdebug.profiler_output_name=trace.%c%p%r%u.out | |||||
| @@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration; | |||||
| /** | /** | ||||
| * Auto-generated Migration: Please modify to your needs! | * Auto-generated Migration: Please modify to your needs! | ||||
| */ | */ | ||||
| final class Version20240312084330 extends AbstractMigration | |||||
| final class Version20240318162352 extends AbstractMigration | |||||
| { | { | ||||
| public function getDescription(): string | public function getDescription(): string | ||||
| { | { | ||||
| @@ -29,18 +29,18 @@ final class Version20240312084330 extends AbstractMigration | |||||
| $this->addSql('CREATE TABLE task (id INT AUTO_INCREMENT NOT NULL, created_by_id INT NOT NULL, assigned_to_id INT NOT NULL, partner_id INT DEFAULT NULL, contact_id INT DEFAULT NULL, headline VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, due_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', prio VARCHAR(255) NOT NULL, completed TINYINT(1) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_527EDB25B03A8386 (created_by_id), INDEX IDX_527EDB25F4BD7827 (assigned_to_id), INDEX IDX_527EDB259393F8FE (partner_id), INDEX IDX_527EDB25E7A1254A (contact_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | $this->addSql('CREATE TABLE task (id INT AUTO_INCREMENT NOT NULL, created_by_id INT NOT NULL, assigned_to_id INT NOT NULL, partner_id INT DEFAULT NULL, contact_id INT DEFAULT NULL, headline VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, due_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', prio VARCHAR(255) NOT NULL, completed TINYINT(1) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_527EDB25B03A8386 (created_by_id), INDEX IDX_527EDB25F4BD7827 (assigned_to_id), INDEX IDX_527EDB259393F8FE (partner_id), INDEX IDX_527EDB25E7A1254A (contact_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | ||||
| $this->addSql('CREATE TABLE `user` (id INT AUTO_INCREMENT NOT NULL, image_id INT DEFAULT NULL, email VARCHAR(180) NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, roles JSON NOT NULL COMMENT \'(DC2Type:json)\', password VARCHAR(255) NOT NULL, active TINYINT(1) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), INDEX IDX_8D93D6493DA5256D (image_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | $this->addSql('CREATE TABLE `user` (id INT AUTO_INCREMENT NOT NULL, image_id INT DEFAULT NULL, email VARCHAR(180) NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, roles JSON NOT NULL COMMENT \'(DC2Type:json)\', password VARCHAR(255) NOT NULL, active TINYINT(1) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), INDEX IDX_8D93D6493DA5256D (image_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | ||||
| $this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526C7E3C61F9 FOREIGN KEY (owner_id) REFERENCES `user` (id)'); | $this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526C7E3C61F9 FOREIGN KEY (owner_id) REFERENCES `user` (id)'); | ||||
| $this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526C9AE985F6 FOREIGN KEY (posting_id) REFERENCES posting (id)'); | |||||
| $this->addSql('ALTER TABLE contact ADD CONSTRAINT FK_4C62E6389393F8FE FOREIGN KEY (partner_id) REFERENCES partner (id)'); | |||||
| $this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526C9AE985F6 FOREIGN KEY (posting_id) REFERENCES posting (id) ON DELETE CASCADE'); | |||||
| $this->addSql('ALTER TABLE contact ADD CONSTRAINT FK_4C62E6389393F8FE FOREIGN KEY (partner_id) REFERENCES partner (id) ON DELETE CASCADE'); | |||||
| $this->addSql('ALTER TABLE contact ADD CONSTRAINT FK_4C62E6383DA5256D FOREIGN KEY (image_id) REFERENCES media_object (id) ON DELETE SET NULL'); | $this->addSql('ALTER TABLE contact ADD CONSTRAINT FK_4C62E6383DA5256D FOREIGN KEY (image_id) REFERENCES media_object (id) ON DELETE SET NULL'); | ||||
| $this->addSql('ALTER TABLE partner ADD CONSTRAINT FK_312B3E16F98F144A FOREIGN KEY (logo_id) REFERENCES media_object (id) ON DELETE SET NULL'); | $this->addSql('ALTER TABLE partner ADD CONSTRAINT FK_312B3E16F98F144A FOREIGN KEY (logo_id) REFERENCES media_object (id) ON DELETE SET NULL'); | ||||
| $this->addSql('ALTER TABLE posting ADD CONSTRAINT FK_BD275D737E3C61F9 FOREIGN KEY (owner_id) REFERENCES `user` (id)'); | |||||
| $this->addSql('ALTER TABLE posting ADD CONSTRAINT FK_BD275D739393F8FE FOREIGN KEY (partner_id) REFERENCES partner (id)'); | |||||
| $this->addSql('ALTER TABLE posting ADD CONSTRAINT FK_BD275D73E7A1254A FOREIGN KEY (contact_id) REFERENCES contact (id)'); | |||||
| $this->addSql('ALTER TABLE posting ADD CONSTRAINT FK_BD275D737E3C61F9 FOREIGN KEY (owner_id) REFERENCES `user` (id) ON DELETE CASCADE'); | |||||
| $this->addSql('ALTER TABLE posting ADD CONSTRAINT FK_BD275D739393F8FE FOREIGN KEY (partner_id) REFERENCES partner (id) ON DELETE CASCADE'); | |||||
| $this->addSql('ALTER TABLE posting ADD CONSTRAINT FK_BD275D73E7A1254A FOREIGN KEY (contact_id) REFERENCES contact (id) ON DELETE CASCADE'); | |||||
| $this->addSql('ALTER TABLE product ADD CONSTRAINT FK_D34A04AD3DA5256D FOREIGN KEY (image_id) REFERENCES media_object (id) ON DELETE SET NULL'); | $this->addSql('ALTER TABLE product ADD CONSTRAINT FK_D34A04AD3DA5256D FOREIGN KEY (image_id) REFERENCES media_object (id) ON DELETE SET NULL'); | ||||
| $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB25B03A8386 FOREIGN KEY (created_by_id) REFERENCES `user` (id)'); | $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB25B03A8386 FOREIGN KEY (created_by_id) REFERENCES `user` (id)'); | ||||
| $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB25F4BD7827 FOREIGN KEY (assigned_to_id) REFERENCES `user` (id)'); | $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB25F4BD7827 FOREIGN KEY (assigned_to_id) REFERENCES `user` (id)'); | ||||
| $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB259393F8FE FOREIGN KEY (partner_id) REFERENCES partner (id) ON DELETE SET NULL'); | |||||
| $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB25E7A1254A FOREIGN KEY (contact_id) REFERENCES contact (id) ON DELETE SET NULL'); | |||||
| $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB259393F8FE FOREIGN KEY (partner_id) REFERENCES partner (id) ON DELETE CASCADE'); | |||||
| $this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB25E7A1254A FOREIGN KEY (contact_id) REFERENCES contact (id) ON DELETE CASCADE'); | |||||
| $this->addSql('ALTER TABLE `user` ADD CONSTRAINT FK_8D93D6493DA5256D FOREIGN KEY (image_id) REFERENCES media_object (id) ON DELETE SET NULL'); | $this->addSql('ALTER TABLE `user` ADD CONSTRAINT FK_8D93D6493DA5256D FOREIGN KEY (image_id) REFERENCES media_object (id) ON DELETE SET NULL'); | ||||
| } | } | ||||
| @@ -82,6 +82,12 @@ class PartnerApi | |||||
| #[ApiProperty(writable: false)] | #[ApiProperty(writable: false)] | ||||
| public ?\DateTimeImmutable $createdAt = null; | public ?\DateTimeImmutable $createdAt = null; | ||||
| /** | |||||
| * @var array<int, PostingApi> | |||||
| */ | |||||
| #[ApiProperty(writable: false)] | |||||
| public array $posts = []; | |||||
| /** | /** | ||||
| * @var array<int, ContactApi> | * @var array<int, ContactApi> | ||||
| */ | */ | ||||
| @@ -35,7 +35,7 @@ use Symfony\Component\Validator\Constraints as Assert; | |||||
| validationContext: ['groups' => ['Default', 'postValidation']] | validationContext: ['groups' => ['Default', 'postValidation']] | ||||
| ), | ), | ||||
| new Patch( | new Patch( | ||||
| security: 'is_granted("is_granted("EDIT", object)")' | |||||
| security: 'is_granted("ROLE_USER")' | |||||
| ), | ), | ||||
| new Delete( | new Delete( | ||||
| security: 'is_granted("ROLE_USER")', | security: 'is_granted("ROLE_USER")', | ||||
| @@ -45,7 +45,6 @@ use Symfony\Component\Validator\Constraints as Assert; | |||||
| provider: EntityToDtoStateProvider::class, | provider: EntityToDtoStateProvider::class, | ||||
| processor: EntityClassDtoStateProcessor::class, | processor: EntityClassDtoStateProcessor::class, | ||||
| stateOptions: new Options(entityClass: Task::class), | stateOptions: new Options(entityClass: Task::class), | ||||
| )] | )] | ||||
| class TaskApi | class TaskApi | ||||
| { | { | ||||
| @@ -23,6 +23,7 @@ class TesController extends AbstractController | |||||
| #[Route('/foo')] | #[Route('/foo')] | ||||
| public function test2() { | public function test2() { | ||||
| phpinfo(); | |||||
| return new JsonResponse('nenene'); | return new JsonResponse('nenene'); | ||||
| } | } | ||||
| } | } | ||||
| @@ -22,7 +22,7 @@ class Comment | |||||
| private ?User $owner = null; | private ?User $owner = null; | ||||
| #[ORM\ManyToOne(inversedBy: 'comments')] | #[ORM\ManyToOne(inversedBy: 'comments')] | ||||
| #[ORM\JoinColumn(nullable: false)] | |||||
| #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')] | |||||
| private ?Posting $posting = null; | private ?Posting $posting = null; | ||||
| #[ORM\Column] | #[ORM\Column] | ||||
| @@ -24,7 +24,7 @@ class Contact | |||||
| private ?string $lastName = null; | private ?string $lastName = null; | ||||
| #[ORM\ManyToOne(inversedBy: 'contacts')] | #[ORM\ManyToOne(inversedBy: 'contacts')] | ||||
| #[ORM\JoinColumn(nullable: false)] | |||||
| #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')] | |||||
| private ?Partner $partner = null; | private ?Partner $partner = null; | ||||
| #[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)] | #[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)] | ||||
| @@ -46,7 +46,7 @@ class Contact | |||||
| #[ORM\Column] | #[ORM\Column] | ||||
| private ?\DateTimeImmutable $createdAt = null; | private ?\DateTimeImmutable $createdAt = null; | ||||
| #[ORM\OneToMany(mappedBy: 'contact', targetEntity: Posting::class, orphanRemoval: true)] | |||||
| #[ORM\OneToMany(mappedBy: 'contact', targetEntity: Posting::class)] | |||||
| private Collection $posts; | private Collection $posts; | ||||
| public function __construct(Partner $partner) | public function __construct(Partner $partner) | ||||
| @@ -43,14 +43,15 @@ class Partner | |||||
| #[ORM\Column] | #[ORM\Column] | ||||
| private ?\DateTimeImmutable $createdAt = null; | private ?\DateTimeImmutable $createdAt = null; | ||||
| #[ORM\OneToMany(mappedBy: 'partner', targetEntity: Contact::class, orphanRemoval: true)] | |||||
| #[ORM\OneToMany(mappedBy: 'partner', targetEntity: Contact::class)] | |||||
| private Collection $contacts; | private Collection $contacts; | ||||
| #[ORM\ManyToOne(targetEntity: MediaObject::class)] | #[ORM\ManyToOne(targetEntity: MediaObject::class)] | ||||
| #[ORM\JoinColumn(nullable: true, onDelete: "SET NULL")] | #[ORM\JoinColumn(nullable: true, onDelete: "SET NULL")] | ||||
| private ?MediaObject $logo = null; | private ?MediaObject $logo = null; | ||||
| #[ORM\OneToMany(mappedBy: 'partner', targetEntity: Posting::class, orphanRemoval: true)] | |||||
| //#[ORM\OneToMany(mappedBy: 'partner', targetEntity: Posting::class, orphanRemoval: true)] | |||||
| #[ORM\OneToMany(mappedBy: 'partner', targetEntity: Posting::class)] | |||||
| private Collection $postings; | private Collection $postings; | ||||
| public function __construct() | public function __construct() | ||||
| @@ -23,20 +23,21 @@ class Posting | |||||
| private ?string $message = null; | private ?string $message = null; | ||||
| #[ORM\ManyToOne(inversedBy: 'postings')] | #[ORM\ManyToOne(inversedBy: 'postings')] | ||||
| #[ORM\JoinColumn(nullable: false)] | |||||
| #[ORM\JoinColumn(nullable: false, onDelete: "CASCADE")] | |||||
| private ?User $owner = null; | private ?User $owner = null; | ||||
| #[ORM\ManyToOne(inversedBy: 'postings')] | #[ORM\ManyToOne(inversedBy: 'postings')] | ||||
| #[ORM\JoinColumn(nullable: false)] | |||||
| #[ORM\JoinColumn(nullable: false, onDelete: "CASCADE")] | |||||
| private ?Partner $partner = null; | private ?Partner $partner = null; | ||||
| #[ORM\ManyToOne(inversedBy: 'postings')] | #[ORM\ManyToOne(inversedBy: 'postings')] | ||||
| #[ORM\JoinColumn(nullable: true, onDelete: "CASCADE")] | |||||
| private ?Contact $contact = null; | private ?Contact $contact = null; | ||||
| #[ORM\Column] | #[ORM\Column] | ||||
| private ?\DateTimeImmutable $createdAt = null; | private ?\DateTimeImmutable $createdAt = null; | ||||
| #[ORM\OneToMany(mappedBy: 'posting', targetEntity: Comment::class, orphanRemoval: true)] | |||||
| #[ORM\OneToMany(mappedBy: 'posting', targetEntity: Comment::class)] | |||||
| private Collection $comments; | private Collection $comments; | ||||
| public function __construct(User $owner, Partner $partner, Contact $contact = null) | public function __construct(User $owner, Partner $partner, Contact $contact = null) | ||||
| @@ -33,11 +33,11 @@ class Task | |||||
| private ?\DateTimeImmutable $dueAt = null; | private ?\DateTimeImmutable $dueAt = null; | ||||
| #[ORM\ManyToOne] | #[ORM\ManyToOne] | ||||
| #[ORM\JoinColumn(nullable: true, onDelete: "SET NULL")] | |||||
| #[ORM\JoinColumn(nullable: true, onDelete: "CASCADE")] | |||||
| private ?Partner $partner = null; | private ?Partner $partner = null; | ||||
| #[ORM\ManyToOne] | #[ORM\ManyToOne] | ||||
| #[ORM\JoinColumn(nullable: true, onDelete: "SET NULL")] | |||||
| #[ORM\JoinColumn(nullable: true, onDelete: "CASCADE")] | |||||
| private ?Contact $contact = null; | private ?Contact $contact = null; | ||||
| #[ORM\Column(type: 'string', enumType: PrioType::class)] | #[ORM\Column(type: 'string', enumType: PrioType::class)] | ||||
| @@ -46,10 +46,10 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface | |||||
| #[ORM\Column] | #[ORM\Column] | ||||
| private ?\DateTimeImmutable $createdAt = null; | private ?\DateTimeImmutable $createdAt = null; | ||||
| #[ORM\OneToMany(mappedBy: 'owner', targetEntity: Posting::class, orphanRemoval: true)] | |||||
| #[ORM\OneToMany(mappedBy: 'owner', targetEntity: Posting::class)] | |||||
| private Collection $postings; | private Collection $postings; | ||||
| #[ORM\OneToMany(mappedBy: 'owner', targetEntity: Comment::class, orphanRemoval: true)] | |||||
| #[ORM\OneToMany(mappedBy: 'owner', targetEntity: Comment::class)] | |||||
| private Collection $comments; | private Collection $comments; | ||||
| @@ -4,8 +4,10 @@ namespace App\Mapper; | |||||
| use App\ApiResource\ContactApi; | use App\ApiResource\ContactApi; | ||||
| use App\ApiResource\PartnerApi; | use App\ApiResource\PartnerApi; | ||||
| use App\ApiResource\PostingApi; | |||||
| use App\Entity\Contact; | use App\Entity\Contact; | ||||
| use App\Entity\Partner; | use App\Entity\Partner; | ||||
| use App\Entity\Posting; | |||||
| use App\Service\FileUrlService; | use App\Service\FileUrlService; | ||||
| use Symfonycasts\MicroMapper\AsMapper; | use Symfonycasts\MicroMapper\AsMapper; | ||||
| use Symfonycasts\MicroMapper\MapperInterface; | use Symfonycasts\MicroMapper\MapperInterface; | ||||
| @@ -50,6 +52,11 @@ class PartnerEntityToApiMapper implements MapperInterface | |||||
| $dto->logo = $entity->getLogo(); | $dto->logo = $entity->getLogo(); | ||||
| $dto->logoUrl = $this->fileUrlService->getFileUrl($entity->getLogo()); | $dto->logoUrl = $this->fileUrlService->getFileUrl($entity->getLogo()); | ||||
| $dto->createdAt = $entity->getCreatedAt(); | $dto->createdAt = $entity->getCreatedAt(); | ||||
| $dto->posts = array_map(function(Posting $posting) { | |||||
| return $this->microMapper->map($posting, PostingApi::class, [ | |||||
| MicroMapperInterface::MAX_DEPTH => 1, | |||||
| ]); | |||||
| }, $entity->getPostings()->getValues()); | |||||
| $dto->contacts = array_map(function(Contact $contact) { | $dto->contacts = array_map(function(Contact $contact) { | ||||
| return $this->microMapper->map($contact, ContactApi::class, [ | return $this->microMapper->map($contact, ContactApi::class, [ | ||||
| MicroMapperInterface::MAX_DEPTH => 1, | MicroMapperInterface::MAX_DEPTH => 1, | ||||
| @@ -2,6 +2,8 @@ | |||||
| namespace App\Mapper; | namespace App\Mapper; | ||||
| use App\ApiResource\ContactApi; | |||||
| use App\ApiResource\PartnerApi; | |||||
| use App\ApiResource\TaskApi; | use App\ApiResource\TaskApi; | ||||
| use App\Entity\Contact; | use App\Entity\Contact; | ||||
| use App\Entity\Partner; | use App\Entity\Partner; | ||||
| @@ -63,12 +65,22 @@ class TaskApiToEntityMapper implements MapperInterface | |||||
| $entity->setHeadline($dto->headline); | $entity->setHeadline($dto->headline); | ||||
| $entity->setDescription($dto->description); | $entity->setDescription($dto->description); | ||||
| $entity->setDueAt($dto->dueAt); | $entity->setDueAt($dto->dueAt); | ||||
| $entity->setPartner($this->microMapper->map($dto->partner, Partner::class, [ | |||||
| MicroMapperInterface::MAX_DEPTH => 1, | |||||
| ])); | |||||
| $entity->setContact($this->microMapper->map($dto->contact, Contact::class, [ | |||||
| MicroMapperInterface::MAX_DEPTH => 1, | |||||
| ])); | |||||
| $entity->setPartner(null); | |||||
| if ($dto->partner !== null) { | |||||
| assert($dto->partner instanceof PartnerApi); | |||||
| $entity->setPartner($this->microMapper->map($dto->partner, Partner::class, [ | |||||
| MicroMapperInterface::MAX_DEPTH => 1, | |||||
| ])); | |||||
| } | |||||
| $entity->setContact(null); | |||||
| if ($dto->contact !== null) { | |||||
| assert($dto->contact instanceof ContactApi); | |||||
| $entity->setContact($this->microMapper->map($dto->contact, Contact::class, [ | |||||
| MicroMapperInterface::MAX_DEPTH => 1, | |||||
| ])); | |||||
| } | |||||
| $entity->setPrio($dto->prio); | $entity->setPrio($dto->prio); | ||||
| $entity->setCompleted($dto->completed); | $entity->setCompleted($dto->completed); | ||||
| return $entity; | return $entity; | ||||
| @@ -42,7 +42,7 @@ class EntityClassDtoStateProcessor implements ProcessorInterface | |||||
| return null; | return null; | ||||
| } | } | ||||
| //dd($entity, $operation, $uriVariables, $context); | |||||
| $this->persistProcessor->process($entity, $operation, $uriVariables, $context); | $this->persistProcessor->process($entity, $operation, $uriVariables, $context); | ||||
| $data->id = $entity->getId(); | $data->id = $entity->getId(); | ||||
| @@ -51,6 +51,18 @@ class CommentResourceTest extends KernelTestCase | |||||
| $token = $this->JWTManager->create($user->object()); | $token = $this->JWTManager->create($user->object()); | ||||
| $this->browser() | |||||
| ->get('/api/comments', [ | |||||
| 'headers' => [ | |||||
| 'Authorization' => 'Bearer ' . $token, | |||||
| ], | |||||
| ]) | |||||
| ->assertSuccessful() | |||||
| ->assertJsonMatches('"hydra:totalItems"', 1) | |||||
| //->assertJsonMatches('"hydra:member"[0].message', 'my comment') | |||||
| ; | |||||
| $this->browser() | $this->browser() | ||||
| ->post('/api/comments' , [ | ->post('/api/comments' , [ | ||||
| 'json' => [ | 'json' => [ | ||||
| @@ -7,7 +7,6 @@ | |||||
| namespace App\Tests\Functional; | namespace App\Tests\Functional; | ||||
| use App\Enum\PartnerType; | |||||
| use App\Factory\MediaObjectLogoFactory; | use App\Factory\MediaObjectLogoFactory; | ||||
| use App\Factory\MediaObjectContactFactory; | use App\Factory\MediaObjectContactFactory; | ||||
| use App\Factory\PartnerFactory; | use App\Factory\PartnerFactory; | ||||