This repository was archived by the owner on Dec 11, 2023. It is now read-only.
File tree 6 files changed +38
-9
lines changed
tests/src/Backoffice/Courses
6 files changed +38
-9
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ APP_SECRET=29ac4a5187930cd4b689aa0f3ee7cbc0
8
8
# --------------------------------#
9
9
# MySql
10
10
MOOC_DATABASE_DRIVER = pdo_mysql
11
- MOOC_DATABASE_HOST = localhost
11
+ MOOC_DATABASE_HOST = codelytv-php_ddd_skeleton-mooc-mysql
12
12
MOOC_DATABASE_PORT = 3306
13
13
MOOC_DATABASE_NAME = mooc
14
14
MOOC_DATABASE_USER = root
@@ -18,7 +18,7 @@ MOOC_DATABASE_PASSWORD=
18
18
# --------------------------------#
19
19
# MySql
20
20
BACKOFFICE_DATABASE_DRIVER = pdo_mysql
21
- BACKOFFICE_DATABASE_HOST = localhost
21
+ BACKOFFICE_DATABASE_HOST = codelytv-php_ddd_skeleton-mooc-mysql
22
22
BACKOFFICE_DATABASE_PORT = 3306
23
23
BACKOFFICE_DATABASE_NAME = mooc
24
24
BACKOFFICE_DATABASE_USER = root
Original file line number Diff line number Diff line change
1
+ name : CI
2
+
3
+ on : [push]
4
+
5
+ jobs :
6
+ build :
7
+
8
+ runs-on : ubuntu-latest
9
+
10
+ steps :
11
+ - uses : actions/checkout@v1
12
+
13
+ - name : Install dependencies
14
+ run : make composer-install
15
+
16
+ - name : Start all the environment
17
+ run : make start
18
+
19
+ - name : Wait for the environment to get up
20
+ run : |
21
+ while ! docker exec codelytv-php_ddd_skeleton-mooc-mysql mysqladmin --user=root --password= --host "127.0.0.1" ping --silent &> /dev/null ; do
22
+ echo "Waiting for database connection..."
23
+ sleep 2
24
+ done
25
+
26
+ - name : Run the tests
27
+ run : make test
Original file line number Diff line number Diff line change 8
8
9
9
/vendor /
10
10
.phpunit.result.cache
11
+
12
+ /build
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ deps: composer-install
10
10
composer-install : CMD=install
11
11
composer-update : CMD=update
12
12
composer composer-install composer-update :
13
- @docker run --rm --interactive --tty -- volume $(current-dir ) :/app --user $(id -u ) :$(id -g ) \
13
+ @docker run --rm --interactive --volume $(current-dir ) :/app --user $(id -u ) :$(id -g ) \
14
14
clevyr/prestissimo $(CMD ) \
15
15
--ignore-platform-reqs \
16
16
--no-ansi \
@@ -21,11 +21,10 @@ reload:
21
21
@docker-compose exec nginx nginx -s reload
22
22
23
23
test :
24
- @docker exec -it codelytv-cqrs_ddd_php_example -php make run-tests
24
+ @docker exec codelytv-php_ddd_skeleton -php make run-tests
25
25
26
26
run-tests :
27
27
mkdir -p build/test_results/phpunit
28
- ./vendor/bin/phpstan analyse -l 7 -c etc/phpstan/phpstan.neon applications/mooc_backend/src
29
28
./vendor/bin/phpunit --exclude-group=' disabled' --log-junit build/test_results/phpunit/junit.xml tests
30
29
./vendor/bin/behat -p mooc_backend --format=progress -v
31
30
Original file line number Diff line number Diff line change 1
1
date.timezone = " UTC"
2
2
html_errors = " On"
3
3
display_errors = " On"
4
- error_reporting = E_ALL
4
+ error_reporting = E_ALL
Original file line number Diff line number Diff line change 4
4
5
5
namespace CodelyTv \Tests \Backoffice \Courses ;
6
6
7
- use CodelyTv \Backoffice \Courses \Domain \ BackofficeCourseRepository ;
7
+ use CodelyTv \Backoffice \Courses \Infrastructure \ Persistence \ MySqlBackofficeCourseRepository ;
8
8
use CodelyTv \Tests \Mooc \Shared \Infrastructure \PhpUnit \MoocContextInfrastructureTestCase ;
9
+ use Doctrine \ORM \EntityManager ;
9
10
10
11
abstract class BackofficeCoursesModuleInfrastructureTestCase extends MoocContextInfrastructureTestCase
11
12
{
12
- protected function repository (): BackofficeCourseRepository
13
+ protected function repository (): MySqlBackofficeCourseRepository
13
14
{
14
- return $ this ->service (BackofficeCourseRepository ::class);
15
+ return new MySqlBackofficeCourseRepository ( $ this ->service (EntityManager ::class) );
15
16
}
16
17
}
You can’t perform that action at this time.
0 commit comments