From 7601a194ab0880d8537ae76ce105e15c5b970aa9 Mon Sep 17 00:00:00 2001 From: IvanC Date: Wed, 24 Mar 2021 18:29:25 +0100 Subject: [PATCH 1/3] Version de mysql para chip M1 --- docker-compose.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2af2539f2..9ccd324f3 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,18 +27,21 @@ services: mooc_mysql: container_name: codelytv-php_ddd_skeleton-mooc-mysql - image: mysql:8.0 + image: mysql/mysql-server:8.0.23 ports: - 3360:3306 environment: - MYSQL_ROOT_PASSWORD= - MYSQL_ALLOW_EMPTY_PASSWORD=yes + - MYSQL_ROOT_HOST=% healthcheck: test: ["CMD", "mysqladmin", "--user=root", "--password=", "--host=127.0.0.1", "ping", "--silent"] interval: 2s timeout: 10s retries: 10 - command: ["--default-authentication-plugin=mysql_native_password"] + command: ["--lower_case_table_names=1"] + + backoffice_elasticsearch: container_name: codelytv-php_ddd_skeleton-backoffice-elastic @@ -101,4 +104,4 @@ services: - shared_rabbitmq - shared_prometheus - mooc_mysql - command: symfony serve --dir=apps/mooc/backend/public --port=8030 --force-php-discovery + command: symfony serve --dir=apps/mooc/backend/public --port=8030 --force-php-discovery \ No newline at end of file From 7a2df447fe93d173d7d62d411680760281713a07 Mon Sep 17 00:00:00 2001 From: IvanC Date: Wed, 24 Mar 2021 18:59:31 +0100 Subject: [PATCH 2/3] Version de elasticsearch para chip M1 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 9ccd324f3..91ba43819 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,7 +45,7 @@ services: backoffice_elasticsearch: container_name: codelytv-php_ddd_skeleton-backoffice-elastic - image: docker.elastic.co/elasticsearch/elasticsearch:6.8.10 + image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0 ports: - 9200:9200 - 9300:9300 From 38832c46bcdfa6319bfeef00022ae30d4fbd50d6 Mon Sep 17 00:00:00 2001 From: IvanC Date: Thu, 25 Mar 2021 17:21:46 +0100 Subject: [PATCH 3/3] Added CourseFinderTest. 2 cases: find and not find a course --- .../Create/CreateCourseCommandHandlerTest.php | 2 +- .../Application/Find/CourseFinderTest.php | 47 +++++++++++++++++++ .../Application/Update/CourseRenamerTest.php | 2 +- 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 tests/Mooc/Courses/Application/Find/CourseFinderTest.php diff --git a/tests/Mooc/Courses/Application/Create/CreateCourseCommandHandlerTest.php b/tests/Mooc/Courses/Application/Create/CreateCourseCommandHandlerTest.php index 6a85c1f1a..dcf5b35c8 100644 --- a/tests/Mooc/Courses/Application/Create/CreateCourseCommandHandlerTest.php +++ b/tests/Mooc/Courses/Application/Create/CreateCourseCommandHandlerTest.php @@ -34,4 +34,4 @@ public function it_should_create_a_valid_course(): void $this->dispatch($command, $this->handler); } -} +} \ No newline at end of file diff --git a/tests/Mooc/Courses/Application/Find/CourseFinderTest.php b/tests/Mooc/Courses/Application/Find/CourseFinderTest.php new file mode 100644 index 000000000..e6a500e56 --- /dev/null +++ b/tests/Mooc/Courses/Application/Find/CourseFinderTest.php @@ -0,0 +1,47 @@ +finder = new CourseFinder($this->repository()); + } + + /** @test */ + public function it_should_throw_an_exception_when_the_course_not_exist(): void + { + $this->expectException(CourseNotExist::class); + + $id = CourseIdMother::create(); + + $this->shouldSearch($id, null); + + $this->finder->__invoke($id); + } + + /** @test */ + public function it_should_find_an_existing_courses(): void + { + $course = CourseMother::create(); + + $this->shouldSearch($course->id(), $course); + + $courseFromRepository = $this->finder->__invoke($course->id()); + + $this->assertEquals($courseFromRepository, $course); + } +} \ No newline at end of file diff --git a/tests/Mooc/Courses/Application/Update/CourseRenamerTest.php b/tests/Mooc/Courses/Application/Update/CourseRenamerTest.php index 2815aa7fe..240cfc628 100644 --- a/tests/Mooc/Courses/Application/Update/CourseRenamerTest.php +++ b/tests/Mooc/Courses/Application/Update/CourseRenamerTest.php @@ -48,4 +48,4 @@ public function it_should_throw_an_exception_when_the_course_not_exist(): void $this->renamer->__invoke($id, CourseNameMother::create()); } -} +} \ No newline at end of file