Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2-widgets2-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
hrzg
yii2-widgets2-module
Commits
a9f4db29
Commit
a9f4db29
authored
Jun 28, 2016
by
Tobias Munk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated tests
parent
4ce63b7f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
4 deletions
+101
-4
Dockerfile
tests/Dockerfile
+1
-3
Makefile
tests/Makefile
+51
-0
giiant.php
tests/_config/giiant.php
+47
-0
docker-compose.yml
tests/docker-compose.yml
+2
-1
No files found.
tests/Dockerfile
View file @
a9f4db29
FROM
phundament/app:4.3.0-beta6
RUN
composer require
-vv
beowulfenator/yii2-json-editor
\ No newline at end of file
FROM
registry-v2.hrzg.de/hrzg/ee:latest
tests/Makefile
0 → 100644
View file @
a9f4db29
.PHONY
:
build test
DOCKER_COMPOSE
?=
docker-compose
WEB_SERVICE
?=
nginx
PHP_SERVICE
?=
phpfpm
DB_SERVICE
?=
db
UNAME_S
:=
$(
shell
uname
-s
)
ifeq
($(UNAME_S),
Darwin)
OPEN_CMD
?=
open
DOCKER_HOST_IP
?=
$(
shell
echo
$(DOCKER_HOST)
|
sed
's/tcp:\/\///'
|
sed
's/:[0-9.]*//'
)
else
OPEN_CMD
?=
xdg-open
DOCKER_HOST_IP
?=
127.0.0.1
endif
all
:
build up setup open
build
:
$(
shell
echo
$(
shell
git describe
--long
--tags
--dirty
--always
)
>
src/version
)
@
echo
$(
shell
cat
src/version
)
$(DOCKER_COMPOSE)
build
--pull
up
:
$(DOCKER_COMPOSE)
up
-d
clean
:
$(DOCKER_COMPOSE)
kill
$(DOCKER_COMPOSE)
rm
-fv
--all
$(DOCKER_COMPOSE)
down
--rmi
local
--remove-orphans
open
:
##
@docker open application web service in browser
$(OPEN_CMD)
http://
$(DOCKER_HOST_IP)
:
$(
shell
$(DOCKER_COMPOSE)
port
$(WEB_SERVICE)
80 |
sed
's/[0-9.]*://'
)
open-db
:
##
@docker open application web service in browser
$(OPEN_CMD)
mysql://root:secret@
$(DOCKER_HOST_IP)
:
$(
shell
$(DOCKER_COMPOSE)
port
$(DB_SERVICE)
3306 |
sed
's/[0-9.]*://'
)
bash
:
##
@docker open application development bash
$(DOCKER_COMPOSE)
run
--rm
$(PHP_SERVICE)
bash
setup
:
##
@docker open application development bash
-
$(DOCKER_COMPOSE)
run
--rm
$(PHP_SERVICE)
yii db/create
-
$(DOCKER_COMPOSE)
run
--rm
$(PHP_SERVICE)
yii migrate
lint
:
mkdir
-p
_artifacts/lint
&&
chmod
-R
777 _artifacts/lint
docker run
--rm
-v
"
${
PWD
}
:/project"
jolicode/phaudit php-cs-fixer fix
--format
=
txt
-v
--dry-run
src
||
export
ERROR
=
1
;
\
docker run
--rm
-v
"
${
PWD
}
:/project"
jolicode/phaudit phpmetrics
--report-html
=
_artifacts/lint/metrics.html src/
||
ERROR
=
1
;
\
docker run
--rm
-v
"
${
PWD
}
:/project"
jolicode/phaudit phpmd src html cleancode,codesize,controversial,design,unusedcode,tests/phpmd/naming.xml
>
_artifacts/lint/mess.html
||
ERROR
=
1
;
\
exit
${
ERROR
}
\ No newline at end of file
tests/_config/giiant.php
0 → 100644
View file @
a9f4db29
<?php
use
schmunk42\giiant\generators\crud\callbacks\base\Callback
;
use
schmunk42\giiant\generators\crud\callbacks\yii\Db
;
use
schmunk42\giiant\generators\crud\callbacks\yii\Html
;
$aceEditorField
=
function
(
$attribute
,
$model
,
$generator
)
{
return
"
\$
form->field(
\$
model, '
{
$attribute
}
')->widget(
\\
trntv
\\
aceeditor
\\
AceEditor::className())"
;
};
$jsonEditorField
=
function
(
$attribute
,
$model
,
$generator
)
{
return
<<<CODE
\$form->field(\$model, '{$attribute}')->widget(beowulfenator\\JsonEditor\\JsonEditorWidget::className(), [
'schema' => \yii\helpers\Json::decode(hrzg\widget\models\crud\WidgetTemplate::find(['id'=>1])->one()->json_schema),
'clientOptions' => [
#'theme' => 'bootstrap3',
'disable_collapse' => true,
'disable_edit_json' => true,
'disable_properties' => true,
'no_additional_properties' => true,
],
]);
CODE;
};
\Yii
::
$container
->
set
(
'schmunk42\giiant\generators\crud\providers\CallbackProvider'
,
[
'columnFormats'
=>
[
// hide system fields, but not ID in table
'created_at$|updated_at$'
=>
Callback
::
false
(),
// hide all TEXT or TINYTEXT columns
'.*'
=>
Db
::
falseIfText
(),
],
'activeFields'
=>
[
// hide system fields in form
'id$'
=>
Db
::
falseIfAutoIncrement
(),
'id$|created_at$|updated_at$'
=>
Callback
::
false
(),
'schema$'
=>
$aceEditorField
,
'json'
=>
$jsonEditorField
,
],
'attributeFormats'
=>
[
// render HTML output
'_html$'
=>
Html
::
attribute
(),
],
]
);
\ No newline at end of file
tests/docker-compose.yml
View file @
a9f4db29
...
...
@@ -25,6 +25,7 @@ services:
DB_PORT_3306_TCP_PORT
:
3306
DB_ENV_MYSQL_ROOT_USER
:
root
DB_ENV_MYSQL_ROOT_PASSWORD
:
secretadmin
MYSQL_PASSWORD
:
secretadmin
volumes
:
-
/app
-
../:/app/vendor/hrzg/yii2-widgets2-module
...
...
@@ -38,7 +39,7 @@ services:
MYSQL_ROOT_PASSWORD
:
secretadmin
seleniumfirefox
:
image
:
'
selenium/standalone-firefox-debug:2.
47.1
'
image
:
'
selenium/standalone-firefox-debug:2.
53.0
'
expose
:
-
'
4444'
ports
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment