Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2-giiant
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dmstr
yii2-giiant
Commits
5e8b3aa8
Commit
5e8b3aa8
authored
Apr 12, 2016
by
Tobias Munk
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature/issue-138
parents
fa8ed24a
21973929
Pipeline
#8939
failed with stages
Changes
20
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
21 additions
and
2717 deletions
+21
-2717
.gitlab-ci.yml
.gitlab-ci.yml
+2
-2
acceptance.php
tests/_config/acceptance.php
+6
-0
config.php
tests/_config/config.php
+3
-0
functional.php
tests/_config/functional.php
+0
-30
CliHelper.php
tests/_helpers/CliHelper.php
+0
-22
FunctionalHelper.php
tests/_helpers/FunctionalHelper.php
+0
-10
FunctionalTester.php
tests/_helpers/FunctionalTester.php
+0
-26
UnitHelper.php
tests/_helpers/UnitHelper.php
+0
-10
CliTesterActions.php
tests/_helpers/_generated/CliTesterActions.php
+1
-13
FunctionalTesterActions.php
tests/_helpers/_generated/FunctionalTesterActions.php
+0
-2556
UnitTesterActions.php
tests/_helpers/_generated/UnitTesterActions.php
+1
-2
LoginPage.php
tests/_pages/LoginPage.php
+1
-1
cli.suite.yml
tests/cli.suite.yml
+0
-1
docker-compose.override-dist.yml
tests/docker-compose.override-dist.yml
+0
-9
docker-compose.yml
tests/docker-compose.yml
+6
-3
functional.suite.yml
tests/functional.suite.yml
+0
-16
_bootstrap.php
tests/functional/_bootstrap.php
+0
-3
CrudCept.php
tests/functional/sakila/CrudCept.php
+0
-11
EmptyCept.php
tests/functional/tagai/EmptyCept.php
+0
-1
unit.suite.yml
tests/unit.suite.yml
+1
-1
No files found.
.gitlab-ci.yml
View file @
5e8b3aa8
...
...
@@ -2,7 +2,6 @@ before_script:
-
export BUILD_PREFIX=buildref${CI_BUILD_REF}$(echo ${CI_BUILD_REF_NAME} | tr -dc '[:alnum:]\n\r' | tr '[:upper:]' '[:lower:]')giiant
-
export COMPOSE_PROJECT_NAME=${BUILD_PREFIX}
-
cd tests
-
cp docker-compose.override-dist.yml docker-compose.override.yml
stages
:
-
test
...
...
@@ -18,7 +17,8 @@ test:
-
sleep 10
-
docker-compose run --rm phpfpm setup.sh
-
set +e
-
docker-compose run --rm -e YII_ENV=test phpfpm codecept run --steps --html=_report.html -g mandatory -g ${GIIANT_TEST_DB} cli,unit,functional,acceptance; TESTS_EXIT_CODE=$?
-
docker-compose run --rm -e YII_ENV=dev phpfpm bash -c 'codecept run --steps --html=_report.html -g mandatory -g ${GIIANT_TEST_DB} cli' || TESTS_EXIT_CODE=1
-
docker-compose run --rm -e YII_ENV=dev phpfpm bash -c 'codecept run --steps --html=_report.html -g mandatory -g ${GIIANT_TEST_DB} unit,acceptance' || TESTS_EXIT_CODE=1
-
cp -r _output /tmp/${BUILD_PREFIX}
-
set -e
-
exit $TESTS_EXIT_CODE
...
...
tests/_config/acceptance.php
View file @
5e8b3aa8
...
...
@@ -11,5 +11,11 @@ return yii\helpers\ArrayHelper::merge(
[
'controllerNamespace'
=>
'app\controllers'
,
'language'
=>
'en'
,
'modules'
=>
[
'sakila'
=>
[
'class'
=>
'yii\sakila\Module'
,
'allowedIPs'
=>
'*'
]
]
]
);
tests/_config/config.php
View file @
5e8b3aa8
...
...
@@ -10,6 +10,9 @@ return [
'gii'
=>
[
'class'
=>
'yii\gii\Module'
,
'allowedIPs'
=>
'*'
],
'sakila'
=>
[
'class'
=>
'app\modules\sakila\Module'
,
]
],
];
tests/_config/functional.php
deleted
100755 → 0
View file @
fa8ed24a
<?php
/**
* Application configuration for unit tests
*/
$_SERVER
[
'SCRIPT_FILENAME'
]
=
YII_TEST_ENTRY_FILE
;
$_SERVER
[
'SCRIPT_NAME'
]
=
YII_TEST_ENTRY_URL
;
$basePath
=
'/app'
;
return
yii\helpers\ArrayHelper
::
merge
(
require
(
$basePath
.
'/src/config/main.php'
),
require
(
__DIR__
.
'/config.php'
),
[
'controllerNamespace'
=>
'app\controllers'
,
'components'
=>
[
'request'
=>
[
// it's not recommended to run functional tests with CSRF validation enabled
'enableCsrfValidation'
=>
false
,
'cookieValidationKey'
=>
uniqid
(
'TESTING-'
),
// but if you absolutely need it set cookie domain to localhost
/*
'csrfCookie' => [
'domain' => 'localhost',
],
*/
],
],
]
);
tests/_helpers/CliHelper.php
deleted
100644 → 0
View file @
fa8ed24a
<?php
namespace
Codeception\Module
;
// here you can define custom functions for CliGuy
class
CliHelper
extends
\Codeception\Module
{
public
function
runShellCmd
(
$command
,
$failNonZero
=
true
)
{
$data
=
array
();
#exec($command, $data, $resultCode);
exec
(
"/app/yii 'migrate'"
,
$data
,
$resultCode
);
$this
->
output
=
implode
(
"
\n
"
,
$data
);
if
(
$this
->
output
===
null
)
{
\PHPUnit_Framework_Assert
::
fail
(
"
$command
can't be executed"
);
}
if
(
$resultCode
!==
0
&&
$failNonZero
)
{
\PHPUnit_Framework_Assert
::
fail
(
"Result code was
$resultCode
.
\n\n
"
.
$this
->
output
);
}
$this
->
debug
(
preg_replace
(
'~s/\e\[\d+(?>(;\d+)*)m//g~'
,
''
,
$this
->
output
));
}
}
tests/_helpers/FunctionalHelper.php
deleted
100644 → 0
View file @
fa8ed24a
<?php
namespace
Codeception\Module
;
// here you can define custom actions
// all public methods declared in helper class will be available in $I
class
FunctionalHelper
extends
\Codeception\Module
{
}
tests/_helpers/FunctionalTester.php
deleted
100644 → 0
View file @
fa8ed24a
<?php
/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
*
* @SuppressWarnings(PHPMD)
*/
class
FunctionalTester
extends
\Codeception\Actor
{
use
_generated\FunctionalTesterActions
;
/**
* Define custom actions here
*/
}
tests/_helpers/UnitHelper.php
deleted
100644 → 0
View file @
fa8ed24a
<?php
namespace
Codeception\Module
;
// here you can define custom actions
// all public methods declared in helper class will be available in $I
class
UnitHelper
extends
\Codeception\Module
{
}
tests/_helpers/_generated/CliTesterActions.php
View file @
5e8b3aa8
<?php
//[STAMP]
33ba7c80e2577d6ac8ef41e7f7aaad5a
<?php
//[STAMP]
ebc9e817e95a85adbdeda62cb1003395
namespace
_generated
;
// This class was automatically generated by build task
...
...
@@ -7,7 +7,6 @@ namespace _generated;
use
Codeception\Module\Filesystem
;
use
Codeception\Module\Cli
;
use
Codeception\Module\CliHelper
;
trait
CliTesterActions
{
...
...
@@ -487,15 +486,4 @@ trait CliTesterActions
public
function
seeShellOutputMatches
(
$regex
)
{
return
$this
->
getScenario
()
->
runStep
(
new
\Codeception\Step\Assertion
(
'seeShellOutputMatches'
,
func_get_args
()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\CliHelper::runShellCmd()
*/
public
function
runShellCmd
(
$command
,
$failNonZero
=
null
)
{
return
$this
->
getScenario
()
->
runStep
(
new
\Codeception\Step\Action
(
'runShellCmd'
,
func_get_args
()));
}
}
tests/_helpers/_generated/FunctionalTesterActions.php
deleted
100644 → 0
View file @
fa8ed24a
This diff is collapsed.
Click to expand it.
tests/_helpers/_generated/UnitTesterActions.php
View file @
5e8b3aa8
<?php
//[STAMP]
edb6aa7f939a5dbf370d33e2c69c0f52
<?php
//[STAMP]
7e9a9989a025d721f4a8bd2b3dc6a71e
namespace
_generated
;
// This class was automatically generated by build task
...
...
@@ -6,7 +6,6 @@ namespace _generated;
// @codingStandardsIgnoreFile
use
Codeception\Module\Asserts
;
use
Codeception\Module\UnitHelper
;
trait
UnitTesterActions
{
...
...
tests/_pages/LoginPage.php
View file @
5e8b3aa8
...
...
@@ -22,7 +22,7 @@ class LoginPage extends BasePage
$this
->
actor
->
fillField
(
'input[name="login-form[password]"]'
,
$password
);
$this
->
actor
->
click
(
'Sign in'
);
if
(
method_exists
(
$this
->
actor
,
'waitForElement'
))
{
$this
->
actor
->
waitFor
Element
(
'.user-footer'
,
5
);
$this
->
actor
->
waitFor
Text
(
$username
,
5
);
}
}
}
tests/cli.suite.yml
View file @
5e8b3aa8
...
...
@@ -9,7 +9,6 @@ modules:
enabled
:
-
Filesystem
-
Cli
-
CliHelper
config
:
PhpBrowser
:
url
:
'
http://localhost/myapp/'
tests/docker-compose.override-dist.yml
deleted
100644 → 0
View file @
fa8ed24a
version
:
'
2'
services
:
phpfpm
:
volumes
:
# host volume for local debugging of generated files
-
tmpvolume:/app/src/modules/${GIIANT_TEST_DB}
volumes
:
tmpvolume
:
\ No newline at end of file
tests/docker-compose.yml
View file @
5e8b3aa8
...
...
@@ -10,15 +10,18 @@ services:
-
DB_ENV_MYSQL_ROOT_PASSWORD=secretadmin
-
DATABASE_DSN_DB=${GIIANT_TEST_DB}
-
GIIANT_TEST_DB=${GIIANT_TEST_DB}
-
"
APP_MIGRATION_LOOKUP=@vendor/schmunk42/yii2-giiant/tests/_migrations"
-
APP_CONFIG_FILE=/app/vendor/schmunk42/yii2-giiant/tests/_config/local.php
-
APP_MIGRATION_LOOKUP=@vendor/schmunk42/yii2-giiant/tests/_migrations
depends_on
:
-
mariadb
-
seleniumfirefox
volumes
:
-
/app
# host volume for local de
bugging of generated files
# host volume for local de
velopment
-
../:/app/vendor/schmunk42/yii2-giiant
-
../tests/_config/local.php:/app/src/config/local.php
# host volume for local debugging of generated files
-
./tmp/${GIIANT_TEST_DB}:/app/src/modules/${GIIANT_TEST_DB}
nginx
:
image
:
schmunk42/nginx:1.9
...
...
@@ -40,7 +43,7 @@ services:
-
./_build/test.cnf:/etc/mysql/conf.d/test.cnf
seleniumfirefox
:
image
:
'
selenium/standalone-firefox-debug:2.
48.2
'
image
:
'
selenium/standalone-firefox-debug:2.
53.0
'
expose
:
-
'
4444'
ports
:
...
...
tests/functional.suite.yml
deleted
100644 → 0
View file @
fa8ed24a
# Codeception Test Suite Configuration
# suite for functional (integration) tests.
# emulate web requests and make application process them.
# (tip: better to use with frameworks).
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
#basic/web/index.php
class_name
:
FunctionalTester
modules
:
enabled
:
-
Filesystem
-
Yii2
config
:
Yii2
:
configFile
:
'
tests/_config/functional.php'
tests/functional/_bootstrap.php
deleted
100644 → 0
View file @
fa8ed24a
<?php
$config
=
require
(
dirname
(
__DIR__
)
.
'/_config/functional.php'
);
new
yii\web\Application
(
$config
);
tests/functional/sakila/CrudCept.php
deleted
100755 → 0
View file @
fa8ed24a
<?php
// @group sakila
use
schmunk42\giiant\tests\_pages\LoginPage
;
$I
=
new
FunctionalTester
(
$scenario
);
$I
->
wantTo
(
'ensure that crud works (WITHOUT access rules applied!)'
);
$I
->
amOnPage
(
'/en/crud/film'
);
$I
->
see
(
'Films'
,
'h1'
);
tests/functional/tagai/EmptyCept.php
deleted
100755 → 0
View file @
fa8ed24a
<?php
tests/unit.suite.yml
View file @
5e8b3aa8
...
...
@@ -3,4 +3,4 @@
# suite for unit (internal) tests.
class_name
:
UnitTester
modules
:
enabled
:
[
Asserts
,
UnitHelper
]
enabled
:
[
Asserts
]
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