Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
1e24d60b
Commit
1e24d60b
authored
Dec 13, 2013
by
Mark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added new extension yii2-codeception, modified composer settings
parent
520b491d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
0 deletions
+102
-0
composer.json
apps/basic/composer.json
+1
-0
composer.json
composer.json
+2
-0
BasePage.php
extensions/codeception/BasePage.php
+45
-0
TestCase.php
extensions/codeception/TestCase.php
+54
-0
No files found.
apps/basic/composer.json
View file @
1e24d60b
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
"yiisoft/yii2"
:
"*"
,
"yiisoft/yii2"
:
"*"
,
"yiisoft/yii2-swiftmailer"
:
"*"
,
"yiisoft/yii2-swiftmailer"
:
"*"
,
"yiisoft/yii2-bootstrap"
:
"*"
,
"yiisoft/yii2-bootstrap"
:
"*"
,
"yiisoft/yii2-codeception"
:
"*"
,
"yiisoft/yii2-debug"
:
"*"
,
"yiisoft/yii2-debug"
:
"*"
,
"yiisoft/yii2-gii"
:
"*"
"yiisoft/yii2-gii"
:
"*"
},
},
...
...
composer.json
View file @
1e24d60b
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
"minimum-stability"
:
"dev"
,
"minimum-stability"
:
"dev"
,
"replace"
:
{
"replace"
:
{
"yiisoft/yii2-bootstrap"
:
"self.version"
,
"yiisoft/yii2-bootstrap"
:
"self.version"
,
"yiisoft/yii2-codeception"
:
"self.version"
,
"yiisoft/yii2-debug"
:
"self.version"
,
"yiisoft/yii2-debug"
:
"self.version"
,
"yiisoft/yii2-elasticsearch"
:
"self.version"
,
"yiisoft/yii2-elasticsearch"
:
"self.version"
,
"yiisoft/yii2-gii"
:
"self.version"
,
"yiisoft/yii2-gii"
:
"self.version"
,
...
@@ -79,6 +80,7 @@
...
@@ -79,6 +80,7 @@
"autoload"
:
{
"autoload"
:
{
"psr-0"
:
{
"psr-0"
:
{
"yii
\\
bootstrap
\\
"
:
"extensions/bootstrap/"
,
"yii
\\
bootstrap
\\
"
:
"extensions/bootstrap/"
,
"yii
\\
codeception
\\
"
:
"extensions/codeception/"
,
"yii
\\
debug
\\
"
:
"extensions/debug/"
,
"yii
\\
debug
\\
"
:
"extensions/debug/"
,
"yii
\\
elasticsearch
\\
"
:
"extensions/elasticsearch/"
,
"yii
\\
elasticsearch
\\
"
:
"extensions/elasticsearch/"
,
"yii
\\
gii
\\
"
:
"extensions/gii/"
,
"yii
\\
gii
\\
"
:
"extensions/gii/"
,
...
...
extensions/codeception/BasePage.php
0 → 100644
View file @
1e24d60b
<?php
namespace
yii\codeception
;
class
BasePage
{
// include url of current page
public
static
$URL
=
''
;
/**
* Declare UI map for this page here. CSS or XPath allowed.
* public static $usernameField = '#username';
* public static $formSubmitButton = "#mainForm input[type=submit]";
*/
/**
* Basic route example for your current URL
* You can append any additional parameter to URL
* and use it in tests like: EditPage::route('/123-post');
*/
public
static
function
route
(
$param
)
{
return
static
::
$URL
.
$param
;
}
/**
* @var
*/
protected
$guy
;
public
function
__construct
(
$I
)
{
$this
->
guy
=
$I
;
}
/**
* @return $this
*/
public
static
function
of
(
$I
)
{
return
new
static
(
$I
);
}
}
extensions/codeception/TestCase.php
0 → 100644
View file @
1e24d60b
<?php
namespace
yii\codeception
;
use
Yii
;
class
TestCase
extends
\PHPUnit_Framework_TestCase
{
/**
* Your application base config that will be used for creating application each time before test.
* This can be an array or alias, pointing to the config file. For example for console application it can be
* '@tests/unit/console_bootstrap.php' that can be similar to existing unit tests bootstrap file.
* @var mixed
*/
protected
$baseConfig
=
'@tests/unit/_bootstrap.php'
;
/**
* Your application config, will be merged with base config when creating application. Can be an alias too.
* @var mixed
*/
protected
$config
=
array
();
/**
* Created application class
* @var string
*/
protected
$appClass
=
'\yii\web\Application'
;
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
mockApplication
();
}
protected
function
tearDown
()
{
$this
->
destroyApplication
();
parent
::
tearDown
();
}
protected
function
mockApplication
()
{
$baseConfig
=
is_array
(
$this
->
baseConfig
)
?
$this
->
baseConfig
:
require
(
Yii
::
getAlias
(
$this
->
baseConfig
,
true
));
$config
=
is_array
(
$this
->
config
)
?
$this
->
config
:
require
(
Yii
::
getAlias
(
$this
->
config
,
true
));
new
$this
->
appClass
(
\yii\helpers\ArrayHelper
::
merge
(
$baseConfig
,
$config
));
}
protected
function
destroyApplication
()
{
\Yii
::
$app
=
null
;
}
}
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