File tree Expand file tree Collapse file tree 5 files changed +113
-2
lines changed
tests/unit/Codeception/Module/Db Expand file tree Collapse file tree 5 files changed +113
-2
lines changed Original file line number Diff line number Diff line change 5
5
/Robofile.php export-ignore
6
6
/* .md export-ignore
7
7
/* .yml export-ignore
8
+ /* .Dockerfile export-ignore
Original file line number Diff line number Diff line change
1
+ version : " 3.9"
2
+
3
+ services :
4
+
5
+ php74 :
6
+ image : codeception-module-db-php74:2.2.0
7
+ build :
8
+ context : .
9
+ dockerfile : ./php74.Dockerfile
10
+ environment :
11
+ MYSQL_DSN : " mysql:host=host.docker.internal;port=3102;dbname=codeception"
12
+ MYSQL_USER : root
13
+ MYSQL_PASSWORD : codeception
14
+ XDEBUG_MODE : " debug"
15
+ XDEBUG_CONFIG : " client_host=host.docker.internal; client_port=9000; mode=debug; start_wih_request=1"
16
+ PHP_IDE_CONFIG : " serverName=codeception-module-db" # the name must be the same as in your PHP -> Server -> "name" field
17
+ volumes :
18
+ - " .:/var/www/html"
19
+
20
+ php81 :
21
+ image : codeception-module-db-php81:2.2.0
22
+ build :
23
+ context : .
24
+ dockerfile : ./php81.Dockerfile
25
+ environment :
26
+ MYSQL_DSN : " mysql:host=host.docker.internal;port=3102;dbname=codeception"
27
+ MYSQL_USER : root
28
+ MYSQL_PASSWORD : codeception
29
+ XDEBUG_MODE : " debug"
30
+ XDEBUG_CONFIG : " client_host=host.docker.internal; client_port=9000; mode=debug; start_wih_request=1"
31
+ PHP_IDE_CONFIG : " serverName=codeception-module-db" # the name must be the same as in your PHP -> Server -> "name" field
32
+ volumes :
33
+ - " .:/var/www/html"
34
+
35
+ mariadb105 :
36
+ image : mariadb:10.5
37
+ environment :
38
+ MARIADB_ROOT_PASSWORD : codeception
39
+ MARIADB_DATABASE : codeception
40
+ ports :
41
+ - " 3102:3306"
42
+
Original file line number Diff line number Diff line change
1
+ FROM php:7.4-cli
2
+
3
+ RUN apt-get update && \
4
+ apt-get install -y \
5
+ unzip \
6
+ wget \
7
+ git \
8
+ zlib1g-dev \
9
+ libzip-dev \
10
+ mariadb-client-10.5
11
+
12
+ RUN docker-php-ext-install pdo pdo_mysql && docker-php-ext-enable pdo pdo_mysql
13
+ RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli
14
+ RUN docker-php-ext-install zip
15
+
16
+ RUN pecl install xdebug-3.1.5 && \
17
+ echo zend_extension=xdebug.so > $PHP_INI_DIR/conf.d/xdebug.ini
18
+
19
+ COPY --from=composer /usr/bin/composer /usr/bin/composer
20
+
21
+ WORKDIR /var/www/html
22
+
23
+ COPY composer.json .
24
+ COPY composer.lock .
25
+
26
+ RUN composer install --no-autoloader
27
+
28
+ COPY . .
29
+
30
+ RUN composer dump-autoload -o
31
+
32
+ ENTRYPOINT ["tail" ]
33
+ CMD ["-f" , "/dev/null" ]
Original file line number Diff line number Diff line change
1
+ FROM php:8.1-cli
2
+
3
+ RUN apt-get update && \
4
+ apt-get install -y \
5
+ unzip \
6
+ wget \
7
+ git \
8
+ zlib1g-dev \
9
+ libzip-dev \
10
+ mariadb-client-10.5
11
+
12
+ RUN docker-php-ext-install pdo pdo_mysql && docker-php-ext-enable pdo pdo_mysql
13
+ RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli
14
+ RUN docker-php-ext-install zip
15
+
16
+ RUN pecl install xdebug-3.1.5 && \
17
+ echo zend_extension=xdebug.so > $PHP_INI_DIR/conf.d/xdebug.ini
18
+
19
+ COPY --from=composer /usr/bin/composer /usr/bin/composer
20
+
21
+ WORKDIR /var/www/html
22
+
23
+ COPY composer.json .
24
+ COPY composer.lock .
25
+
26
+ RUN composer install --no-autoloader
27
+
28
+ COPY . .
29
+
30
+ RUN composer dump-autoload -o
31
+
32
+ ENTRYPOINT ["tail" ]
33
+ CMD ["-f" , "/dev/null" ]
Original file line number Diff line number Diff line change @@ -23,11 +23,13 @@ public function getPopulator(): string
23
23
public function getConfig (): array
24
24
{
25
25
$ host = getenv ('MYSQL_HOST ' ) ? getenv ('MYSQL_HOST ' ) : 'localhost ' ;
26
+ $ user = getenv ('MYSQL_USER ' ) ? getenv ('MYSQL_USER ' ) : 'root ' ;
26
27
$ password = getenv ('MYSQL_PASSWORD ' ) ? getenv ('MYSQL_PASSWORD ' ) : '' ;
28
+ $ dsn = getenv ('MYSQL_DSN ' ) ? getenv ('MYSQL_DSN ' ) : 'mysql:host= ' .$ host .';dbname=codeception_test ' ;
27
29
28
30
return [
29
- 'dsn ' => ' mysql:host= ' . $ host . ' ;dbname=codeception_test ' ,
30
- 'user ' => ' root ' ,
31
+ 'dsn ' => $ dsn ,
32
+ 'user ' => $ user ,
31
33
'password ' => $ password ,
32
34
'dump ' => 'tests/data/dumps/mysql.sql ' ,
33
35
'reconnect ' => true ,
You can’t perform that action at this time.
0 commit comments