Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ APP_SECRET=29ac4a5187930cd4b689aa0f3ee7cbc0
#--------------------------------#
# MySql
MOOC_DATABASE_DRIVER=pdo_mysql
MOOC_DATABASE_HOST=localhost
MOOC_DATABASE_HOST=codelytv-php_ddd_skeleton-mooc-mysql
MOOC_DATABASE_PORT=3306
MOOC_DATABASE_NAME=mooc
MOOC_DATABASE_USER=root
Expand All @@ -18,7 +18,7 @@ MOOC_DATABASE_PASSWORD=
#--------------------------------#
# MySql
BACKOFFICE_DATABASE_DRIVER=pdo_mysql
BACKOFFICE_DATABASE_HOST=localhost
BACKOFFICE_DATABASE_HOST=codelytv-php_ddd_skeleton-mooc-mysql
BACKOFFICE_DATABASE_PORT=3306
BACKOFFICE_DATABASE_NAME=mooc
BACKOFFICE_DATABASE_USER=root
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Install dependencies
run: make composer-install

- name: Start all the environment
run: make start

- name: Wait for the environment to get up
run: |
while ! docker exec codelytv-php_ddd_skeleton-mooc-mysql mysqladmin --user=root --password= --host "127.0.0.1" ping --silent &> /dev/null ; do
echo "Waiting for database connection..."
sleep 2
done

- name: Run the tests
run: make test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@

/vendor/
.phpunit.result.cache

/build
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ deps: composer-install
composer-install: CMD=install
composer-update: CMD=update
composer composer-install composer-update:
@docker run --rm --interactive --tty --volume $(current-dir):/app --user $(id -u):$(id -g) \
@docker run --rm --interactive --volume $(current-dir):/app --user $(id -u):$(id -g) \
clevyr/prestissimo $(CMD) \
--ignore-platform-reqs \
--no-ansi \
Expand All @@ -21,11 +21,10 @@ reload:
@docker-compose exec nginx nginx -s reload

test:
@docker exec -it codelytv-cqrs_ddd_php_example-php make run-tests
@docker exec codelytv-php_ddd_skeleton-php make run-tests

run-tests:
mkdir -p build/test_results/phpunit
./vendor/bin/phpstan analyse -l 7 -c etc/phpstan/phpstan.neon applications/mooc_backend/src
./vendor/bin/phpunit --exclude-group='disabled' --log-junit build/test_results/phpunit/junit.xml tests
./vendor/bin/behat -p mooc_backend --format=progress -v

Expand Down
2 changes: 1 addition & 1 deletion etc/infrastructure/php/php.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
date.timezone = "UTC"
html_errors = "On"
display_errors = "On"
error_reporting = E_ALL
error_reporting = E_ALL
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

namespace CodelyTv\Tests\Backoffice\Courses;

use CodelyTv\Backoffice\Courses\Domain\BackofficeCourseRepository;
use CodelyTv\Backoffice\Courses\Infrastructure\Persistence\MySqlBackofficeCourseRepository;
use CodelyTv\Tests\Mooc\Shared\Infrastructure\PhpUnit\MoocContextInfrastructureTestCase;
use Doctrine\ORM\EntityManager;

abstract class BackofficeCoursesModuleInfrastructureTestCase extends MoocContextInfrastructureTestCase
{
protected function repository(): BackofficeCourseRepository
protected function repository(): MySqlBackofficeCourseRepository
{
return $this->service(BackofficeCourseRepository::class);
return new MySqlBackofficeCourseRepository($this->service(EntityManager::class));
}
}