From 58cb34f39bec8af194b38e2bbf08af7fce33f5c5 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Mon, 26 Apr 2021 17:09:54 +0200 Subject: [PATCH 01/14] Creation of entities : SocialIssue / Social Action / Result / Goal --- .../Entity/SocialWork/Goal.php | 121 ++++++++++ .../Entity/SocialWork/Result.php | 125 ++++++++++ .../Entity/SocialWork/SocialAction.php | 214 ++++++++++++++++++ .../Entity/SocialWork/SocialIssue.php | 154 +++++++++++++ .../Repository/SocialWork/GoalRepository.php | 50 ++++ .../SocialWork/ResultRepository.php | 50 ++++ .../SocialWork/SocialActionRepository.php | 50 ++++ .../SocialWork/SocialIssueRepository.php | 50 ++++ .../migrations/Version20210426145930.php | 80 +++++++ 9 files changed, 894 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/Entity/SocialWork/Goal.php create mode 100644 src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php create mode 100644 src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php create mode 100644 src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php create mode 100644 src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php create mode 100644 src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php create mode 100644 src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php create mode 100644 src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php create mode 100644 src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Goal.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Goal.php new file mode 100644 index 000000000..c86c0fd7f --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Goal.php @@ -0,0 +1,121 @@ +socialActions = new ArrayCollection(); + $this->results = new ArrayCollection(); + } + + public function getTitle(): ?array + { + return $this->title; + } + + public function setTitle(array $title): self + { + $this->title = $title; + + return $this; + } + + public function getDesactivationDate(): ?\DateTimeInterface + { + return $this->desactivationDate; + } + + public function setDesactivationDate(?\DateTimeInterface $desactivationDate): self + { + $this->desactivationDate = $desactivationDate; + + return $this; + } + + /** + * @return Collection|SocialAction[] + */ + public function getSocialActions(): Collection + { + return $this->socialActions; + } + + public function addSocialAction(SocialAction $socialAction): self + { + if (!$this->socialActions->contains($socialAction)) { + $this->socialActions[] = $socialAction; + } + + return $this; + } + + public function removeSocialAction(SocialAction $socialAction): self + { + $this->socialActions->removeElement($socialAction); + + return $this; + } + + /** + * @return Collection|Result[] + */ + public function getResults(): Collection + { + return $this->results; + } + + public function addResult(Result $result): self + { + if (!$this->results->contains($result)) { + $this->results[] = $result; + } + + return $this; + } + + public function removeResult(Result $result): self + { + $this->results->removeElement($result); + + return $this; + } +} diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php new file mode 100644 index 000000000..04009a9f6 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php @@ -0,0 +1,125 @@ +socialActions = new ArrayCollection(); + $this->goals = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getTitle(): ?array + { + return $this->title; + } + + public function setTitle(array $title): self + { + $this->title = $title; + + return $this; + } + + public function getDesactivationDate(): ?\DateTimeInterface + { + return $this->desactivationDate; + } + + public function setDesactivationDate(?\DateTimeInterface $desactivationDate): self + { + $this->desactivationDate = $desactivationDate; + + return $this; + } + + /** + * @return Collection|SocialAction[] + */ + public function getSocialActions(): Collection + { + return $this->socialActions; + } + + public function addSocialAction(SocialAction $socialAction): self + { + if (!$this->socialActions->contains($socialAction)) { + $this->socialActions[] = $socialAction; + } + + return $this; + } + + public function removeSocialAction(SocialAction $socialAction): self + { + $this->socialActions->removeElement($socialAction); + + return $this; + } + + /** + * @return Collection|Goal[] + */ + public function getGoals(): Collection + { + return $this->goals; + } + + public function addGoal(Goal $goal): self + { + if (!$this->goals->contains($goal)) { + $this->goals[] = $goal; + } + + return $this; + } + + public function removeGoal(Goal $goal): self + { + $this->goals->removeElement($goal); + + return $this; + } +} diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php new file mode 100644 index 000000000..e514d7295 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php @@ -0,0 +1,214 @@ +children = new ArrayCollection(); + $this->goals = new ArrayCollection(); + $this->results = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getDesactivationDate(): ?\DateTimeInterface + { + return $this->desactivationDate; + } + + public function setDesactivationDate(?\DateTimeInterface $desactivationDate): self + { + $this->desactivationDate = $desactivationDate; + + return $this; + } + + public function getIssue(): ?SocialIssue + { + return $this->issue; + } + + public function setIssue(?SocialIssue $issue): self + { + $this->issue = $issue; + + return $this; + } + + public function getParent(): ?self + { + return $this->parent; + } + + public function setParent(?self $parent): self + { + $this->parent = $parent; + + return $this; + } + + /** + * @return Collection|self[] + */ + public function getChildren(): Collection + { + return $this->children; + } + + public function addChild(self $child): self + { + if (!$this->children->contains($child)) { + $this->children[] = $child; + $child->setParent($this); + } + + return $this; + } + + public function removeChild(self $child): self + { + if ($this->children->removeElement($child)) { + // set the owning side to null (unless already changed) + if ($child->getParent() === $this) { + $child->setParent(null); + } + } + + return $this; + } + + public function getDefaultNotificationDelay(): ?\DateInterval + { + return $this->defaultNotificationDelay; + } + + public function setDefaultNotificationDelay(\DateInterval $defaultNotificationDelay): self + { + $this->defaultNotificationDelay = $defaultNotificationDelay; + + return $this; + } + + public function getTitle(): ?array + { + return $this->title; + } + + public function setTitle(array $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return Collection|Goal[] + */ + public function getGoals(): Collection + { + return $this->goals; + } + + public function addGoal(Goal $goal): self + { + if (!$this->goals->contains($goal)) { + $this->goals[] = $goal; + } + + return $this; + } + + public function removeGoal(Goal $goal): self + { + $this->goals->removeElement($goal); + + return $this; + } + + /** + * @return Collection|Result[] + */ + public function getResults(): Collection + { + return $this->results; + } + + public function addResult(Result $result): self + { + if (!$this->results->contains($result)) { + $this->results[] = $result; + } + + return $this; + } + + public function removeResult(Result $result): self + { + $this->results->removeElement($result); + + return $this; + } +} diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php new file mode 100644 index 000000000..78cf6896b --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php @@ -0,0 +1,154 @@ +children = new ArrayCollection(); + $this->socialActions = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getParent(): ?self + { + return $this->parent; + } + + public function setParent(?self $parent): self + { + $this->parent = $parent; + + return $this; + } + + /** + * @return Collection|self[] + */ + public function getChildren(): Collection + { + return $this->children; + } + + public function addChild(self $child): self + { + if (!$this->children->contains($child)) { + $this->children[] = $child; + $child->setParent($this); + } + + return $this; + } + + public function removeChild(self $child): self + { + if ($this->children->removeElement($child)) { + // set the owning side to null (unless already changed) + if ($child->getParent() === $this) { + $child->setParent(null); + } + } + + return $this; + } + + public function getDesactivationDate(): ?\DateTimeInterface + { + return $this->desactivationDate; + } + + public function setDesactivationDate(?\DateTimeInterface $desactivationDate): self + { + $this->desactivationDate = $desactivationDate; + + return $this; + } + + public function getTitle(): ?array + { + return $this->title; + } + + public function setTitle(array $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return Collection|SocialAction[] + */ + public function getSocialActions(): Collection + { + return $this->socialActions; + } + + public function addSocialAction(SocialAction $socialAction): self + { + if (!$this->socialActions->contains($socialAction)) { + $this->socialActions[] = $socialAction; + $socialAction->setSocialIssue($this); + } + + return $this; + } + + public function removeSocialAction(SocialAction $socialAction): self + { + if ($this->socialActions->removeElement($socialAction)) { + // set the owning side to null (unless already changed) + if ($socialAction->getSocialIssue() === $this) { + $socialAction->setSocialIssue(null); + } + } + + return $this; + } +} diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php new file mode 100644 index 000000000..5dedacd09 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('g') + ->andWhere('g.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('g.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?Goal + { + return $this->createQueryBuilder('g') + ->andWhere('g.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php new file mode 100644 index 000000000..72368d665 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('r') + ->andWhere('r.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('r.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?Result + { + return $this->createQueryBuilder('r') + ->andWhere('r.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php new file mode 100644 index 000000000..d3c1ae00f --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('s') + ->andWhere('s.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('s.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?SocialAction + { + return $this->createQueryBuilder('s') + ->andWhere('s.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php new file mode 100644 index 000000000..5736d9d5c --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('s') + ->andWhere('s.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('s.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?SocialIssue + { + return $this->createQueryBuilder('s') + ->andWhere('s.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php b/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php new file mode 100644 index 000000000..892f19b31 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php @@ -0,0 +1,80 @@ +addSql('CREATE SEQUENCE chill_person_social_action_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE chill_person_social_issue_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE chill_person_social_work_goal_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE chill_person_social_work_result_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE chill_person_social_action (id INT NOT NULL, issue_id INT DEFAULT NULL, parent_id INT DEFAULT NULL, desactivationDate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, defaultNotificationDelay INTERVAL NOT NULL, title JSONB NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_B7ABFAB85E7AA58C ON chill_person_social_action (issue_id)'); + $this->addSql('CREATE INDEX IDX_B7ABFAB8727ACA70 ON chill_person_social_action (parent_id)'); + $this->addSql('COMMENT ON COLUMN chill_person_social_action.defaultNotificationDelay IS \'(DC2Type:dateinterval)\''); + $this->addSql('CREATE TABLE chill_person_social_action_goal (socialaction_id INT NOT NULL, goal_id INT NOT NULL, PRIMARY KEY(socialaction_id, goal_id))'); + $this->addSql('CREATE INDEX IDX_163CA4DD3DC32179 ON chill_person_social_action_goal (socialaction_id)'); + $this->addSql('CREATE INDEX IDX_163CA4DD667D1AFE ON chill_person_social_action_goal (goal_id)'); + $this->addSql('CREATE TABLE chill_person_social_action_result (socialaction_id INT NOT NULL, result_id INT NOT NULL, PRIMARY KEY(socialaction_id, result_id))'); + $this->addSql('CREATE INDEX IDX_CA98C58C3DC32179 ON chill_person_social_action_result (socialaction_id)'); + $this->addSql('CREATE INDEX IDX_CA98C58C7A7B643 ON chill_person_social_action_result (result_id)'); + $this->addSql('CREATE TABLE chill_person_social_issue (id INT NOT NULL, parent_id INT DEFAULT NULL, desactivationDate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, title JSONB NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_7A484DAE727ACA70 ON chill_person_social_issue (parent_id)'); + $this->addSql('CREATE TABLE chill_person_social_work_goal (id INT NOT NULL, title JSONB NOT NULL, desactivationDate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE chill_person_social_work_goal_result (goal_id INT NOT NULL, result_id INT NOT NULL, PRIMARY KEY(goal_id, result_id))'); + $this->addSql('CREATE INDEX IDX_F3BAEEA9667D1AFE ON chill_person_social_work_goal_result (goal_id)'); + $this->addSql('CREATE INDEX IDX_F3BAEEA97A7B643 ON chill_person_social_work_goal_result (result_id)'); + $this->addSql('CREATE TABLE chill_person_social_work_result (id INT NOT NULL, title JSONB NOT NULL, desactivationDate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('ALTER TABLE chill_person_social_action ADD CONSTRAINT FK_B7ABFAB85E7AA58C FOREIGN KEY (issue_id) REFERENCES chill_person_social_issue (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_social_action ADD CONSTRAINT FK_B7ABFAB8727ACA70 FOREIGN KEY (parent_id) REFERENCES chill_person_social_action (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_social_action_goal ADD CONSTRAINT FK_163CA4DD3DC32179 FOREIGN KEY (socialaction_id) REFERENCES chill_person_social_action (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_social_action_goal ADD CONSTRAINT FK_163CA4DD667D1AFE FOREIGN KEY (goal_id) REFERENCES chill_person_social_work_goal (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_social_action_result ADD CONSTRAINT FK_CA98C58C3DC32179 FOREIGN KEY (socialaction_id) REFERENCES chill_person_social_action (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_social_action_result ADD CONSTRAINT FK_CA98C58C7A7B643 FOREIGN KEY (result_id) REFERENCES chill_person_social_work_result (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_social_issue ADD CONSTRAINT FK_7A484DAE727ACA70 FOREIGN KEY (parent_id) REFERENCES chill_person_social_issue (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_social_work_goal_result ADD CONSTRAINT FK_F3BAEEA9667D1AFE FOREIGN KEY (goal_id) REFERENCES chill_person_social_work_goal (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_social_work_goal_result ADD CONSTRAINT FK_F3BAEEA97A7B643 FOREIGN KEY (result_id) REFERENCES chill_person_social_work_result (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + } + + public function down(Schema $schema) : void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('ALTER TABLE chill_person_social_action DROP CONSTRAINT FK_B7ABFAB8727ACA70'); + $this->addSql('ALTER TABLE chill_person_social_action_goal DROP CONSTRAINT FK_163CA4DD3DC32179'); + $this->addSql('ALTER TABLE chill_person_social_action_result DROP CONSTRAINT FK_CA98C58C3DC32179'); + $this->addSql('ALTER TABLE chill_person_social_action DROP CONSTRAINT FK_B7ABFAB85E7AA58C'); + $this->addSql('ALTER TABLE chill_person_social_issue DROP CONSTRAINT FK_7A484DAE727ACA70'); + $this->addSql('ALTER TABLE chill_person_social_action_goal DROP CONSTRAINT FK_163CA4DD667D1AFE'); + $this->addSql('ALTER TABLE chill_person_social_work_goal_result DROP CONSTRAINT FK_F3BAEEA9667D1AFE'); + $this->addSql('ALTER TABLE chill_person_social_action_result DROP CONSTRAINT FK_CA98C58C7A7B643'); + $this->addSql('ALTER TABLE chill_person_social_work_goal_result DROP CONSTRAINT FK_F3BAEEA97A7B643'); + $this->addSql('DROP SEQUENCE chill_person_social_action_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE chill_person_social_issue_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE chill_person_social_work_goal_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE chill_person_social_work_result_id_seq CASCADE'); + $this->addSql('DROP TABLE chill_person_social_action'); + $this->addSql('DROP TABLE chill_person_social_action_goal'); + $this->addSql('DROP TABLE chill_person_social_action_result'); + $this->addSql('DROP TABLE chill_person_social_issue'); + $this->addSql('DROP TABLE chill_person_social_work_goal'); + $this->addSql('DROP TABLE chill_person_social_work_goal_result'); + $this->addSql('DROP TABLE chill_person_social_work_result'); + } +} From cda32fb925102a63281f66acfae6320ea4010c02 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Mon, 26 Apr 2021 17:19:10 +0200 Subject: [PATCH 02/14] Pbm migration double --- .../ChillPersonBundle/migrations/Version20210426145930.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php b/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php index 892f19b31..168d6a319 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php @@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration; /** * Auto-generated Migration: Please modify to your needs! */ -final class Version20210426145930X extends AbstractMigration +final class Version20210426145930 extends AbstractMigration { public function getDescription() : string { From 38ac3badefa6c562b92221205aad087a478027f5 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Tue, 27 Apr 2021 11:24:26 +0200 Subject: [PATCH 03/14] Integration rmq Julien --- .../Entity/SocialWork/Goal.php | 2 +- .../Entity/SocialWork/Result.php | 2 +- .../Entity/SocialWork/SocialAction.php | 2 +- .../Entity/SocialWork/SocialIssue.php | 2 +- .../Repository/SocialWork/GoalRepository.php | 29 ------------------- .../SocialWork/ResultRepository.php | 29 ------------------- .../SocialWork/SocialActionRepository.php | 29 ------------------- .../SocialWork/SocialIssueRepository.php | 29 ------------------- .../migrations/Version20210426145930.php | 7 ++--- 9 files changed, 6 insertions(+), 125 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Goal.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Goal.php index c86c0fd7f..adf59d203 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Goal.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Goal.php @@ -47,7 +47,7 @@ class Goal $this->results = new ArrayCollection(); } - public function getTitle(): ?array + public function getTitle(): array { return $this->title; } diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php index 04009a9f6..3ffe9762e 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php @@ -51,7 +51,7 @@ class Result return $this->id; } - public function getTitle(): ?array + public function getTitle(): array { return $this->title; } diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php index e514d7295..690764f39 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php @@ -152,7 +152,7 @@ class SocialAction return $this; } - public function getTitle(): ?array + public function getTitle(): array { return $this->title; } diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php index 78cf6896b..d7817de16 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php @@ -110,7 +110,7 @@ class SocialIssue return $this; } - public function getTitle(): ?array + public function getTitle(): array { return $this->title; } diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php index 5dedacd09..87100d0de 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php @@ -18,33 +18,4 @@ class GoalRepository extends ServiceEntityRepository { parent::__construct($registry, Goal::class); } - - // /** - // * @return Goal[] Returns an array of Goal objects - // */ - /* - public function findByExampleField($value) - { - return $this->createQueryBuilder('g') - ->andWhere('g.exampleField = :val') - ->setParameter('val', $value) - ->orderBy('g.id', 'ASC') - ->setMaxResults(10) - ->getQuery() - ->getResult() - ; - } - */ - - /* - public function findOneBySomeField($value): ?Goal - { - return $this->createQueryBuilder('g') - ->andWhere('g.exampleField = :val') - ->setParameter('val', $value) - ->getQuery() - ->getOneOrNullResult() - ; - } - */ } diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php index 72368d665..11c436da3 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php @@ -18,33 +18,4 @@ class ResultRepository extends ServiceEntityRepository { parent::__construct($registry, Result::class); } - - // /** - // * @return Result[] Returns an array of Result objects - // */ - /* - public function findByExampleField($value) - { - return $this->createQueryBuilder('r') - ->andWhere('r.exampleField = :val') - ->setParameter('val', $value) - ->orderBy('r.id', 'ASC') - ->setMaxResults(10) - ->getQuery() - ->getResult() - ; - } - */ - - /* - public function findOneBySomeField($value): ?Result - { - return $this->createQueryBuilder('r') - ->andWhere('r.exampleField = :val') - ->setParameter('val', $value) - ->getQuery() - ->getOneOrNullResult() - ; - } - */ } diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php index d3c1ae00f..32affaa50 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php @@ -18,33 +18,4 @@ class SocialActionRepository extends ServiceEntityRepository { parent::__construct($registry, SocialAction::class); } - - // /** - // * @return SocialAction[] Returns an array of SocialAction objects - // */ - /* - public function findByExampleField($value) - { - return $this->createQueryBuilder('s') - ->andWhere('s.exampleField = :val') - ->setParameter('val', $value) - ->orderBy('s.id', 'ASC') - ->setMaxResults(10) - ->getQuery() - ->getResult() - ; - } - */ - - /* - public function findOneBySomeField($value): ?SocialAction - { - return $this->createQueryBuilder('s') - ->andWhere('s.exampleField = :val') - ->setParameter('val', $value) - ->getQuery() - ->getOneOrNullResult() - ; - } - */ } diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php index 5736d9d5c..3349f6d00 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php @@ -18,33 +18,4 @@ class SocialIssueRepository extends ServiceEntityRepository { parent::__construct($registry, SocialIssue::class); } - - // /** - // * @return SocialIssue[] Returns an array of SocialIssue objects - // */ - /* - public function findByExampleField($value) - { - return $this->createQueryBuilder('s') - ->andWhere('s.exampleField = :val') - ->setParameter('val', $value) - ->orderBy('s.id', 'ASC') - ->setMaxResults(10) - ->getQuery() - ->getResult() - ; - } - */ - - /* - public function findOneBySomeField($value): ?SocialIssue - { - return $this->createQueryBuilder('s') - ->andWhere('s.exampleField = :val') - ->setParameter('val', $value) - ->getQuery() - ->getOneOrNullResult() - ; - } - */ } diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php b/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php index 168d6a319..7a081c03c 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php @@ -8,18 +8,17 @@ use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; /** - * Auto-generated Migration: Please modify to your needs! + * Create Social action, Social Issue, Work Goal and Work Result */ final class Version20210426145930 extends AbstractMigration { public function getDescription() : string { - return ''; + return 'Create Social action, Social Issue, Work Goal and Work Result'; } public function up(Schema $schema) : void { - // this up() migration is auto-generated, please modify it to your needs $this->addSql('CREATE SEQUENCE chill_person_social_action_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE chill_person_social_issue_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE chill_person_social_work_goal_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); @@ -54,8 +53,6 @@ final class Version20210426145930 extends AbstractMigration public function down(Schema $schema) : void { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE SCHEMA public'); $this->addSql('ALTER TABLE chill_person_social_action DROP CONSTRAINT FK_B7ABFAB8727ACA70'); $this->addSql('ALTER TABLE chill_person_social_action_goal DROP CONSTRAINT FK_163CA4DD3DC32179'); $this->addSql('ALTER TABLE chill_person_social_action_result DROP CONSTRAINT FK_CA98C58C3DC32179'); From 0f9a395dfc26103915a9ac189a359190408524fa Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Tue, 27 Apr 2021 15:10:56 +0200 Subject: [PATCH 04/14] Entites for AccomanyingPeriodWork, AccomanyingPeriodWorkGoal & Social/WorkEvaluation --- .../AccompanyingPeriodWork.php | 309 ++++++++++++++++++ .../AccompanyingPeriodWorkGoal.php | 115 +++++++ .../Entity/SocialWork/Evaluation.php | 93 ++++++ .../Entity/SocialWork/Result.php | 62 ++++ .../AccompanyingPeriodWorkGoalRepository.php | 21 ++ .../AccompanyingPeriodWorkRepository.php | 21 ++ .../SocialWork/EvaluationRepository.php | 21 ++ 7 files changed, 642 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php create mode 100644 src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php create mode 100644 src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php create mode 100644 src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php create mode 100644 src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php create mode 100644 src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php new file mode 100644 index 000000000..92279be2d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -0,0 +1,309 @@ +goals = new ArrayCollection(); + $this->results = new ArrayCollection(); + $this->thirdParties = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getNote(): ?string + { + return $this->note; + } + + public function setNote(string $note): self + { + $this->note = $note; + + return $this; + } + + public function getAccompanyingPeriod(): ?AccompanyingPeriod + { + return $this->accompanyingPeriod; + } + + public function setAccompanyingPeriod(?AccompanyingPeriod $accompanyingPeriod): self + { + $this->accompanyingPeriod = $accompanyingPeriod; + + return $this; + } + + public function getSocialAction(): ?SocialAction + { + return $this->socialAction; + } + + public function setSocialAction(?SocialAction $socialAction): self + { + $this->socialAction = $socialAction; + + return $this; + } + + public function getCreatedAt(): ?\DateTimeInterface + { + return $this->createdAt; + } + + public function setCreatedAt(\DateTimeInterface $createdAt): self + { + $this->createdAt = $createdAt; + + return $this; + } + + public function getCreatedBy(): ?User + { + return $this->createdBy; + } + + public function setCreatedBy(?User $createdBy): self + { + $this->createdBy = $createdBy; + + return $this; + } + + public function getStartDate(): ?\DateTimeInterface + { + return $this->startDate; + } + + public function setStartDate(\DateTimeInterface $startDate): self + { + $this->startDate = $startDate; + + return $this; + } + + public function getEndDate(): ?\DateTimeInterface + { + return $this->endDate; + } + + public function setEndDate(\DateTimeInterface $endDate): self + { + $this->endDate = $endDate; + + return $this; + } + + public function getHandlingThierParty(): ?ThirdParty + { + return $this->handlingThierParty; + } + + public function setHandlingThierParty(?ThirdParty $handlingThierParty): self + { + $this->handlingThierParty = $handlingThierParty; + + return $this; + } + + public function getCreatedAutomatically(): ?bool + { + return $this->createdAutomatically; + } + + public function setCreatedAutomatically(bool $createdAutomatically): self + { + $this->createdAutomatically = $createdAutomatically; + + return $this; + } + + public function getCreatedAutomaticallyReason(): ?string + { + return $this->createdAutomaticallyReason; + } + + public function setCreatedAutomaticallyReason(string $createdAutomaticallyReason): self + { + $this->createdAutomaticallyReason = $createdAutomaticallyReason; + + return $this; + } + + /** + * @return Collection|AccompanyingPeriodWorkGoal[] + */ + public function getGoals(): Collection + { + return $this->goals; + } + + public function addGoal(AccompanyingPeriodWorkGoal $goal): self + { + if (!$this->goals->contains($goal)) { + $this->goals[] = $goal; + $goal->setAccompanyingPeriodWork2($this); + } + + return $this; + } + + public function removeGoal(AccompanyingPeriodWorkGoal $goal): self + { + if ($this->goals->removeElement($goal)) { + // set the owning side to null (unless already changed) + if ($goal->getAccompanyingPeriodWork2() === $this) { + $goal->setAccompanyingPeriodWork2(null); + } + } + + return $this; + } + + /** + * @return Collection|Result[] + */ + public function getResults(): Collection + { + return $this->results; + } + + public function addResult(Result $result): self + { + if (!$this->results->contains($result)) { + $this->results[] = $result; + } + + return $this; + } + + public function removeResult(Result $result): self + { + $this->results->removeElement($result); + + return $this; + } + + /** + * @return Collection|ThirdParty[] + */ + public function getThirdParties(): Collection + { + return $this->thirdParties; + } + + public function addThirdParty(ThirdParty $thirdParty): self + { + if (!$this->thirdParties->contains($thirdParty)) { + $this->thirdParties[] = $thirdParty; + } + + return $this; + } + + public function removeThirdParty(ThirdParty $thirdParty): self + { + $this->thirdParties->removeElement($thirdParty); + + return $this; + } +} diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php new file mode 100644 index 000000000..406e99152 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php @@ -0,0 +1,115 @@ +results = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getNote(): ?string + { + return $this->note; + } + + public function setNote(string $note): self + { + $this->note = $note; + + return $this; + } + + public function getAccompanyingPeriodWork(): ?AccompanyingPeriodWork + { + return $this->accompanyingPeriodWork; + } + + public function setAccompanyingPeriodWork(?AccompanyingPeriodWork $accompanyingPeriodWork): self + { + $this->accompanyingPeriodWork = $accompanyingPeriodWork; + + return $this; + } + + public function getGoal(): ?Goal + { + return $this->goal; + } + + public function setGoal(?Goal $goal): self + { + $this->goal = $goal; + + return $this; + } + + /** + * @return Collection|Result[] + */ + public function getResults(): Collection + { + return $this->results; + } + + public function addResult(Result $result): self + { + if (!$this->results->contains($result)) { + $this->results[] = $result; + } + + return $this; + } + + public function removeResult(Result $result): self + { + $this->results->removeElement($result); + + return $this; + } +} diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php new file mode 100644 index 000000000..1fd6c8734 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php @@ -0,0 +1,93 @@ +id; + } + + public function getTitle(): array + { + return $this->title; + } + + public function setTitle(array $title): self + { + $this->title = $title; + + return $this; + } + + public function getDelay(): ?\DateInterval + { + return $this->delay; + } + + public function setDelay(\DateInterval $delay): self + { + $this->delay = $delay; + + return $this; + } + + public function getNotificationDelay(): ?\DateInterval + { + return $this->notificationDelay; + } + + public function setNotificationDelay(\DateInterval $notificationDelay): self + { + $this->notificationDelay = $notificationDelay; + + return $this; + } + + public function getSocialAction(): ?SocialAction + { + return $this->socialAction; + } + + public function setSocialAction(?SocialAction $socialAction): self + { + $this->socialAction = $socialAction; + + return $this; + } +} diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php index 3ffe9762e..5eb3224bc 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php @@ -2,6 +2,8 @@ namespace App\Entity\Chill\PersonBundle\Entity\SocialWork; +use App\Entity\Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork; +use App\Entity\Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkGoal; use App\Repository\Chill\PersonBundle\Entity\SocialWork\ResultRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; @@ -40,10 +42,22 @@ class Result */ private $goals; + /** + * @ORM\ManyToMany(targetEntity=AccompanyingPeriodWork::class, mappedBy="results") + */ + private $accompanyingPeriodWorks; + + /** + * @ORM\ManyToMany(targetEntity=AccompanyingPeriodWorkGoal::class, mappedBy="results") + */ + private $accompanyingPeriodWorkGoals; + public function __construct() { $this->socialActions = new ArrayCollection(); $this->goals = new ArrayCollection(); + $this->accompanyingPeriodWorks = new ArrayCollection(); + $this->accompanyingPeriodWorkGoals = new ArrayCollection(); } public function getId(): ?int @@ -122,4 +136,52 @@ class Result return $this; } + + /** + * @return Collection|AccompanyingPeriodWork[] + */ + public function getAccompanyingPeriodWorks(): Collection + { + return $this->accompanyingPeriodWorks; + } + + public function addAccompanyingPeriodWork(AccompanyingPeriodWork $accompanyingPeriod): self + { + if (!$this->accompanyingPeriodWorks->contains($accompanyingPeriod)) { + $this->accompanyingPeriodWorks[] = $accompanyingPeriod; + } + + return $this; + } + + public function removeAccompanyingPeriodWork(AccompanyingPeriodWork $accompanyingPeriod): self + { + $this->accompanyingPeriodWorks->removeElement($accompanyingPeriod); + + return $this; + } + + /** + * @return Collection|AccompanyingPeriodWorkGoal[] + */ + public function getAccompanyingPeriodWorkGoals(): Collection + { + return $this->accompanyingPeriodWorkGoals; + } + + public function addAccompanyingPeriodWorkGoal(AccompanyingPeriodWorkGoal $accompanyingPeriodWorkGoal): self + { + if (!$this->accompanyingPeriodWorkGoals->contains($accompanyingPeriodWorkGoal)) { + $this->accompanyingPeriodWorkGoals[] = $accompanyingPeriodWorkGoal; + } + + return $this; + } + + public function removeAccompanyingPeriodWorkGoal(AccompanyingPeriodWorkGoal $accompanyingPeriodWorkGoal): self + { + $this->accompanyingPeriodWorkGoals->removeElement($accompanyingPeriodWorkGoal); + + return $this; + } } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php new file mode 100644 index 000000000..52119cc55 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php @@ -0,0 +1,21 @@ + Date: Tue, 27 Apr 2021 15:11:31 +0200 Subject: [PATCH 05/14] Correct namespace --- .../ChillPersonBundle/migrations/Version20210426145930.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php b/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php index 7a081c03c..177633433 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Application\Migrations; +namespace Chill\Migrations\Person; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; From b8ef0d28f5834619f08e6de65c4bac51ea44f80a Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Tue, 27 Apr 2021 15:15:02 +0200 Subject: [PATCH 06/14] Migration for AccompanyingPeriodWork, AccompanyongPeriodWokGoal & SocialWork/Evaluation --- .../migrations/Version20210427125700.php | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/migrations/Version20210427125700.php diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210427125700.php b/src/Bundle/ChillPersonBundle/migrations/Version20210427125700.php new file mode 100644 index 000000000..853d0b763 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210427125700.php @@ -0,0 +1,77 @@ +addSql('CREATE SEQUENCE chill_person_accompanying_period_work_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE chill_person_accompanying_period_work_goal_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE chill_person_social_work_evaluation_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE chill_person_accompanying_period_work (id INT NOT NULL, note TEXT NOT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, startDate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, endDate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, createdAutomatically BOOLEAN NOT NULL, createdAutomaticallyReason TEXT NOT NULL, accompanyingPeriod_id INT DEFAULT NULL, socialAction_id INT DEFAULT NULL, createdBy_id INT NOT NULL, handlingThierParty_id INT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_B694FB3D7FA8EF0 ON chill_person_accompanying_period_work (accompanyingPeriod_id)'); + $this->addSql('CREATE INDEX IDX_B694FB3BF32A3DA ON chill_person_accompanying_period_work (socialAction_id)'); + $this->addSql('CREATE INDEX IDX_B694FB33174800F ON chill_person_accompanying_period_work (createdBy_id)'); + $this->addSql('CREATE INDEX IDX_B694FB382B35EA7 ON chill_person_accompanying_period_work (handlingThierParty_id)'); + $this->addSql('CREATE TABLE chill_person_accompanying_period_work_result (accompanyingperiodwork_id INT NOT NULL, result_id INT NOT NULL, PRIMARY KEY(accompanyingperiodwork_id, result_id))'); + $this->addSql('CREATE INDEX IDX_46E95929B99F6060 ON chill_person_accompanying_period_work_result (accompanyingperiodwork_id)'); + $this->addSql('CREATE INDEX IDX_46E959297A7B643 ON chill_person_accompanying_period_work_result (result_id)'); + $this->addSql('CREATE TABLE chill_person_accompanying_period_work_third_party (accompanyingperiodwork_id INT NOT NULL, thirdparty_id INT NOT NULL, PRIMARY KEY(accompanyingperiodwork_id, thirdparty_id))'); + $this->addSql('CREATE INDEX IDX_83B57B86B99F6060 ON chill_person_accompanying_period_work_third_party (accompanyingperiodwork_id)'); + $this->addSql('CREATE INDEX IDX_83B57B86C7D3A8E6 ON chill_person_accompanying_period_work_third_party (thirdparty_id)'); + $this->addSql('CREATE TABLE chill_person_accompanying_period_work_goal (id INT NOT NULL, goal_id INT DEFAULT NULL, note TEXT NOT NULL, accompanyingPeriodWork_id INT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_911B88FEC55C1209 ON chill_person_accompanying_period_work_goal (accompanyingPeriodWork_id)'); + $this->addSql('CREATE INDEX IDX_911B88FE667D1AFE ON chill_person_accompanying_period_work_goal (goal_id)'); + $this->addSql('CREATE TABLE chill_person_accompanying_period_work_goal_result (accompanyingperiodworkgoal_id INT NOT NULL, result_id INT NOT NULL, PRIMARY KEY(accompanyingperiodworkgoal_id, result_id))'); + $this->addSql('CREATE INDEX IDX_3E37D1F37B14AD03 ON chill_person_accompanying_period_work_goal_result (accompanyingperiodworkgoal_id)'); + $this->addSql('CREATE INDEX IDX_3E37D1F37A7B643 ON chill_person_accompanying_period_work_goal_result (result_id)'); + $this->addSql('CREATE TABLE chill_person_social_work_evaluation (id INT NOT NULL, title JSONB NOT NULL, delay INTERVAL NOT NULL, notificationDelay INTERVAL NOT NULL, socialAction_id INT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_2E23F3FEBF32A3DA ON chill_person_social_work_evaluation (socialAction_id)'); + $this->addSql('COMMENT ON COLUMN chill_person_social_work_evaluation.delay IS \'(DC2Type:dateinterval)\''); + $this->addSql('COMMENT ON COLUMN chill_person_social_work_evaluation.notificationDelay IS \'(DC2Type:dateinterval)\''); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work ADD CONSTRAINT FK_B694FB3D7FA8EF0 FOREIGN KEY (accompanyingPeriod_id) REFERENCES chill_person_accompanying_period (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work ADD CONSTRAINT FK_B694FB3BF32A3DA FOREIGN KEY (socialAction_id) REFERENCES chill_person_social_action (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work ADD CONSTRAINT FK_B694FB33174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work ADD CONSTRAINT FK_B694FB382B35EA7 FOREIGN KEY (handlingThierParty_id) REFERENCES chill_3party.third_party (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_result ADD CONSTRAINT FK_46E95929B99F6060 FOREIGN KEY (accompanyingperiodwork_id) REFERENCES chill_person_accompanying_period_work (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_result ADD CONSTRAINT FK_46E959297A7B643 FOREIGN KEY (result_id) REFERENCES chill_person_social_work_result (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_third_party ADD CONSTRAINT FK_83B57B86B99F6060 FOREIGN KEY (accompanyingperiodwork_id) REFERENCES chill_person_accompanying_period_work (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_third_party ADD CONSTRAINT FK_83B57B86C7D3A8E6 FOREIGN KEY (thirdparty_id) REFERENCES chill_3party.third_party (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_goal ADD CONSTRAINT FK_911B88FEC55C1209 FOREIGN KEY (accompanyingPeriodWork_id) REFERENCES chill_person_accompanying_period_work (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_goal ADD CONSTRAINT FK_911B88FE667D1AFE FOREIGN KEY (goal_id) REFERENCES chill_person_social_work_goal (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_goal_result ADD CONSTRAINT FK_3E37D1F37B14AD03 FOREIGN KEY (accompanyingperiodworkgoal_id) REFERENCES chill_person_accompanying_period_work_goal (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_goal_result ADD CONSTRAINT FK_3E37D1F37A7B643 FOREIGN KEY (result_id) REFERENCES chill_person_social_work_result (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_social_work_evaluation ADD CONSTRAINT FK_2E23F3FEBF32A3DA FOREIGN KEY (socialAction_id) REFERENCES chill_person_social_action (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + } + + public function down(Schema $schema) : void + { + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_result DROP CONSTRAINT FK_46E95929B99F6060'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_third_party DROP CONSTRAINT FK_83B57B86B99F6060'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_goal DROP CONSTRAINT FK_911B88FEC55C1209'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_goal_result DROP CONSTRAINT FK_3E37D1F37B14AD03'); + $this->addSql('DROP SEQUENCE chill_person_accompanying_period_work_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE chill_person_accompanying_period_work_goal_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE chill_person_social_work_evaluation_id_seq CASCADE'); + $this->addSql('DROP TABLE chill_person_accompanying_period_work'); + $this->addSql('DROP TABLE chill_person_accompanying_period_work_result'); + $this->addSql('DROP TABLE chill_person_accompanying_period_work_third_party'); + $this->addSql('DROP TABLE chill_person_accompanying_period_work_goal'); + $this->addSql('DROP TABLE chill_person_accompanying_period_work_goal_result'); + $this->addSql('DROP TABLE chill_person_social_work_evaluation'); + } +} From 53813f8f297433d8835061eb3e630582afd4f85a Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Fri, 23 Apr 2021 11:13:35 +0200 Subject: [PATCH 07/14] tests/ChillPersonBundle: use mutualized getClientAuthenticated() --- .../Controller/PersonControllerCreateTest.php | 30 ++++++++----------- .../Controller/PersonControllerUpdateTest.php | 8 ++--- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php index 5f0a33fab..bc901e587 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php @@ -24,12 +24,14 @@ namespace Chill\PersonBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\DomCrawler\Form; +use Chill\MainBundle\Test\PrepareClientTrait; /** * Test creation and deletion for persons */ class PersonControllerCreateTest extends WebTestCase { + use PrepareClientTrait; const FIRSTNAME_INPUT = 'chill_personbundle_person_creation[firstName]'; const LASTNAME_INPUT = "chill_personbundle_person_creation[lastName]"; @@ -39,20 +41,12 @@ class PersonControllerCreateTest extends WebTestCase const CENTER_INPUT = "chill_personbundle_person_creation[center]"; const LONG_TEXT = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosq. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosq."; - - /** - * return an authenticated client, useful for submitting form - * - * @return \Symfony\Component\BrowserKit\Client - */ - private function getAuthenticatedClient($username = 'center a_social') + + public function setUp() { - return static::createClient(array(), array( - 'PHP_AUTH_USER' => $username, - 'PHP_AUTH_PW' => 'password', - )); + $this->client = $this::getClientAuthenticated(); } - + /** * * @param Form $creationForm @@ -76,8 +70,8 @@ class PersonControllerCreateTest extends WebTestCase */ public function testAddAPersonPage() { - $client = $this->getAuthenticatedClient(); + $client = $this->client; $crawler = $client->request('GET', '/fr/person/new'); $this->assertTrue($client->getResponse()->isSuccessful(), @@ -122,7 +116,7 @@ class PersonControllerCreateTest extends WebTestCase */ public function testFirstnameTooLong(Form $form) { - $client = $this->getAuthenticatedClient(); + $client = $this-client; $this->fillAValidCreationForm($form); $form->get(self::FIRSTNAME_INPUT)->setValue(mb_substr(self::LONG_TEXT, 0, 256)); $crawler = $client->submit($form); @@ -171,7 +165,7 @@ class PersonControllerCreateTest extends WebTestCase public function testValidForm(Form $form) { $this->fillAValidCreationForm($form); - $client = $this->getAuthenticatedClient(); + $client = $this->client; $client->submit($form); $this->assertTrue($client->getResponse()->isRedirect(), @@ -198,7 +192,7 @@ class PersonControllerCreateTest extends WebTestCase */ public function testPersonViewAccessible($personId) { - $client = $this->getAuthenticatedClient(); + $client = $this->client; $client->request('GET', '/fr/person/'.$personId.'/general'); $this->assertTrue($client->getResponse()->isSuccessful(), @@ -212,7 +206,7 @@ class PersonControllerCreateTest extends WebTestCase */ public function testValidFormWithMultiCenterUser() { - $client = $this->getAuthenticatedClient('multi_center'); + $client = $this->getClientAuthenticated('multi_center'); $crawler = $client->request('GET', '/fr/person/new'); @@ -242,7 +236,7 @@ class PersonControllerCreateTest extends WebTestCase public function testReviewExistingDetectionInversedLastNameWithFirstName() { - $client = $this->getAuthenticatedClient(); + $client = $this->client; $crawler = $client->request('GET', '/fr/person/new'); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php index b7087024d..46fd6dcda 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php @@ -24,6 +24,7 @@ namespace Chill\PersonBundle\Tests\Controller; use Chill\PersonBundle\Entity\Person; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; +use Chill\MainBundle\Test\PrepareClientTrait; /** * Test the edition of persons @@ -34,6 +35,8 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ class PersonControllerUpdateTest extends WebTestCase { + use PrepareClientTrait; + /** @var \Doctrine\ORM\EntityManagerInterface The entity manager */ private $em; @@ -71,10 +74,7 @@ class PersonControllerUpdateTest extends WebTestCase $this->editUrl = '/en/person/'.$this->person->getId().'/general/edit'; $this->viewUrl = '/en/person/'.$this->person->getId().'/general'; - $this->client = static::createClient(array(), array( - 'PHP_AUTH_USER' => 'center a_social', - 'PHP_AUTH_PW' => 'password', - )); + $this->client = $this->getClientAuthenticated(); } /** From 2c96c022612800a8c03247e4bf83f0736979d943 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Tue, 20 Apr 2021 10:07:27 +0200 Subject: [PATCH 08/14] tests/ChillPersonBundle: the gender input has three options: man, women and undefined --- .../Tests/Controller/PersonControllerCreateTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php index bc901e587..81eea1b15 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php @@ -93,9 +93,9 @@ class PersonControllerCreateTest extends WebTestCase $genderType = $form->get(self::GENDER_INPUT); $this->assertEquals('radio', $genderType->getType(), - 'The gender input has two radio button: man and women'); - $this->assertEquals(2, count($genderType->availableOptionValues()), - 'The gender input has two radio button: man and women'); + 'The gender input has radio buttons'); + $this->assertEquals(3, count($genderType->availableOptionValues()), + 'The gender input has three options: man, women and undefined'); $this->assertTrue(in_array('man', $genderType->availableOptionValues()), 'gender has "homme" option'); $this->assertTrue(in_array('woman', $genderType->availableOptionValues()), From 395735e6f75ab521b2c74385fae59790495ca250 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Tue, 20 Apr 2021 16:23:47 +0200 Subject: [PATCH 09/14] tests/ChillPersonBundle: remove broken obsolete testFirstnameTooLong, html input and doctrine contrains are working --- .../Controller/PersonControllerCreateTest.php | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php index 81eea1b15..9faf05510 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php @@ -109,37 +109,6 @@ class PersonControllerCreateTest extends WebTestCase return $form; } - /** - * - * @param Form $form - * @depends testAddAPersonPage - */ - public function testFirstnameTooLong(Form $form) - { - $client = $this-client; - $this->fillAValidCreationForm($form); - $form->get(self::FIRSTNAME_INPUT)->setValue(mb_substr(self::LONG_TEXT, 0, 256)); - $crawler = $client->submit($form); - - $this->assertEquals(1, $crawler->filter('.error')->count(), - "An error message is shown if we fill more than 255 characters in firstname"); - } - - /** - * - * @param Form $form - * @depends testAddAPersonPage - */ - public function testLastnameTooLong(Form $form) - { - $this->fillAValidCreationForm($form); - $form->get(self::LASTNAME_INPUT)->setValue(mb_substr(self::LONG_TEXT, 0, 256)); - $crawler = $this->getAuthenticatedClient()->submit($form); - - $this->assertEquals(1, $crawler->filter('.error')->count(), - "An error message is shown if we fill more than 255 characters in lastname"); - } - /** * * @param Form $form From e4e2138765b600df5c2c5697c74d1d3aa085f510 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Tue, 20 Apr 2021 10:51:37 +0200 Subject: [PATCH 10/14] tests/ChillPersonBundle: replace testGenderIsNull with crafted form as html input now prevents user form not selecting a gender --- .../Controller/PersonControllerCreateTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php index 9faf05510..5ab77ee24 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php @@ -114,14 +114,14 @@ class PersonControllerCreateTest extends WebTestCase * @param Form $form * @depends testAddAPersonPage */ - public function testGenderIsNull(Form $form) + public function testForgedNullGender(Form $form) { - $this->fillAValidCreationForm($form); - $form->get(self::GENDER_INPUT)->disableValidation()->setValue(NULL); - $crawler = $this->getAuthenticatedClient()->submit($form); - - $this->assertEquals(1, $crawler->filter('.error')->count(), - 'A message is shown if gender is not set'); + $form->get(self::FIRSTNAME_INPUT)->setValue('john'); + $form->get(self::LASTNAME_INPUT)->setValue('doe'); + $date = new \DateTime('1947-02-01'); + $form->get(self::BIRTHDATE_INPUT)->setValue($date->format('d-m-Y')); + $this->client->submit($form); + $this->assertResponseStatusCodeSame(500); } /** From f02d6df262213d65535fb7359fc537ad8a9a14d8 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Mon, 26 Apr 2021 09:03:28 +0200 Subject: [PATCH 11/14] tests/ChillPersonBundle: in sf4 container is a static method of KernelTestCase --- .../Tests/Form/Type/PickPersonTypeTest.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php b/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php index 0baf96bfc..cb796b742 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php @@ -36,12 +36,6 @@ class PickPersonTypeTest extends KernelTestCase */ protected $user; - /** - * - * @var \Symfony\Component\DependencyInjection\ContainerInterface - */ - protected $container; - /** * * @var \Symfony\Component\Form\FormFactoryInterface @@ -52,16 +46,14 @@ class PickPersonTypeTest extends KernelTestCase { self::bootKernel(); - $this->container = self::$kernel->getContainer(); - - $this->user = $this->container->get('doctrine.orm.entity_manager') + $this->user = self::$container->get('doctrine.orm.entity_manager') ->getRepository('ChillMainBundle:User') ->findOneBy(array('username' => 'multi_center')); - $this->formFactory = $this->container->get('form.factory'); + $this->formFactory = self::$container->get('form.factory'); $token = (new UsernamePasswordToken($this->user, 'password', 'firewall')); - $this->container->get('security.token_storage') + self::$container->get('security.token_storage') ->setToken($token); } From b43f43fa0bba12ba62ccda0576e818d19e997d78 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Tue, 27 Apr 2021 14:42:41 +0200 Subject: [PATCH 12/14] ChillPersonBundle: persist new Persons --- .../Controller/PersonController.php | 13 ++++++++++++- .../config/services/controller.yaml | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonController.php b/src/Bundle/ChillPersonBundle/Controller/PersonController.php index db2b8b9d1..a167dc589 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonController.php @@ -39,6 +39,7 @@ use Chill\MainBundle\Search\SearchProvider; use Chill\PersonBundle\Repository\PersonRepository; use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper; use Symfony\Component\Validator\Validator\ValidatorInterface; +use Doctrine\ORM\EntityManagerInterface; /** * Class PersonController @@ -76,6 +77,12 @@ class PersonController extends AbstractController */ protected $configPersonAltNameHelper; + /** + * + * @var EntityManagerInterface + */ + protected $em; + /** * @var \Psr\Log\LoggerInterface */ @@ -93,7 +100,8 @@ class PersonController extends AbstractController PersonRepository $personRepository, ConfigPersonAltNamesHelper $configPersonAltNameHelper, LoggerInterface $logger, - ValidatorInterface $validator + ValidatorInterface $validator, + EntityManagerInterface $em ) { $this->similarPersonMatcher = $similarPersonMatcher; $this->translator = $translator; @@ -102,6 +110,7 @@ class PersonController extends AbstractController $this->personRepository = $personRepository; $this->logger = $logger; $this->validator = $validator; + $this->em = $em; } public function getCFGroup() @@ -343,6 +352,8 @@ class PersonController extends AbstractController $this->logger->info('Person created without errors'); } + $this->em->persist($person); + $alternatePersons = $this->similarPersonMatcher ->matchPerson($person); diff --git a/src/Bundle/ChillPersonBundle/config/services/controller.yaml b/src/Bundle/ChillPersonBundle/config/services/controller.yaml index 24b35a8e3..501291974 100644 --- a/src/Bundle/ChillPersonBundle/config/services/controller.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/controller.yaml @@ -8,6 +8,7 @@ services: $configPersonAltNameHelper: '@Chill\PersonBundle\Config\ConfigPersonAltNamesHelper' $logger: '@Psr\Log\LoggerInterface' $validator: '@Symfony\Component\Validator\Validator\ValidatorInterface' + $em: '@Doctrine\ORM\EntityManagerInterface' tags: ['controller.service_arguments'] Chill\PersonBundle\Controller\TimelinePersonController: From e3cc76c689daba46d2769713c8d0ce34393f9d39 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Tue, 27 Apr 2021 14:59:35 +0200 Subject: [PATCH 13/14] tests/ChillPersonBundle: use type casting --- .../Tests/Controller/PersonControllerCreateTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php index 5ab77ee24..c49c0ea97 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php @@ -137,7 +137,7 @@ class PersonControllerCreateTest extends WebTestCase $client = $this->client; $client->submit($form); - $this->assertTrue($client->getResponse()->isRedirect(), + $this->assertTrue((bool)$client->getResponse()->isRedirect(), "a valid form redirect to url /{_locale}/person/{personId}/general/edit"); $client->followRedirect(); From 6e81ef006534f641ffa79c147d32c324a143d840 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Tue, 27 Apr 2021 17:09:41 +0200 Subject: [PATCH 14/14] tests: update chill-app subprojet ref --- tests/app | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/app b/tests/app index 5321a3a45..f15fff5f2 160000 --- a/tests/app +++ b/tests/app @@ -1 +1 @@ -Subproject commit 5321a3a4506f8db0f143909be307ed068e15df9c +Subproject commit f15fff5f2af1c70550155c21e4f365d63c78f1b8