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
520b491d
Commit
520b491d
authored
Dec 13, 2013
by
Mark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified tests according yii2-codeception extension
parent
22b95607
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
7 additions
and
107 deletions
+7
-107
TestCase.php
apps/basic/tests/_helpers/TestCase.php
+0
-56
AboutPage.php
apps/basic/tests/_pages/AboutPage.php
+1
-1
BasePage.php
apps/basic/tests/_pages/BasePage.php
+0
-45
ContactPage.php
apps/basic/tests/_pages/ContactPage.php
+1
-1
LoginPage.php
apps/basic/tests/_pages/LoginPage.php
+1
-1
ContactFormTest.php
apps/basic/tests/unit/models/ContactFormTest.php
+1
-1
LoginFormTest.php
apps/basic/tests/unit/models/LoginFormTest.php
+2
-1
UserTest.php
apps/basic/tests/unit/models/UserTest.php
+1
-1
No files found.
apps/basic/tests/_helpers/TestCase.php
deleted
100644 → 0
View file @
22b95607
<?php
namespace
tests\_helpers
;
class
TestCase
extends
\PHPUnit_Framework_TestCase
{
/**
* Your application config, will be merged with base config when creating application.
* @var array
*/
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
=
require
(
__DIR__
.
'/../unit/_bootstrap.php'
);
$config
=
\yii\helpers\ArrayHelper
::
merge
(
$baseConfig
,
$this
->
config
);
new
$this
->
appClass
(
$config
);
}
protected
function
destroyApplication
()
{
\Yii
::
$app
=
null
;
}
/**
* Use this method when you need to dump variables with var_dump function.
* This is caused by the buffering output of the codeception.
* @param mixed $var
*/
protected
static
function
varDump
(
$var
)
{
ob_start
();
var_dump
(
$var
);
\Codeception\Util\Debug
::
debug
(
ob_get_clean
());
}
}
apps/basic/tests/_pages/AboutPage.php
View file @
520b491d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
namespace
tests\_pages
;
namespace
tests\_pages
;
class
AboutPage
extends
BasePage
class
AboutPage
extends
\yii\codeception\
BasePage
{
{
public
static
$URL
=
'?r=site/about'
;
public
static
$URL
=
'?r=site/about'
;
...
...
apps/basic/tests/_pages/BasePage.php
deleted
100644 → 0
View file @
22b95607
<?php
namespace
tests\_pages
;
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
);
}
}
apps/basic/tests/_pages/ContactPage.php
View file @
520b491d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
namespace
tests\_pages
;
namespace
tests\_pages
;
class
ContactPage
extends
BasePage
class
ContactPage
extends
\yii\codeception\
BasePage
{
{
public
static
$URL
=
'?r=site/contact'
;
public
static
$URL
=
'?r=site/contact'
;
...
...
apps/basic/tests/_pages/LoginPage.php
View file @
520b491d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
namespace
tests\_pages
;
namespace
tests\_pages
;
class
LoginPage
extends
BasePage
class
LoginPage
extends
\yii\codeception\
BasePage
{
{
public
static
$URL
=
'?r=site/login'
;
public
static
$URL
=
'?r=site/login'
;
...
...
apps/basic/tests/unit/models/ContactFormTest.php
View file @
520b491d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
namespace
tests\unit\models
;
namespace
tests\unit\models
;
class
ContactFormTest
extends
\
tests\_helpers
\TestCase
class
ContactFormTest
extends
\
yii\codeception
\TestCase
{
{
}
}
apps/basic/tests/unit/models/LoginFormTest.php
View file @
520b491d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
namespace
tests\unit\models
;
namespace
tests\unit\models
;
class
LoginFormTest
extends
\
tests\_helpers
\TestCase
class
LoginFormTest
extends
\
yii\codeception
\TestCase
{
{
}
}
\ No newline at end of file
apps/basic/tests/unit/models/UserTest.php
View file @
520b491d
...
@@ -4,7 +4,7 @@ namespace tests\unit\models;
...
@@ -4,7 +4,7 @@ namespace tests\unit\models;
#use yii\test\DbTestTrait;
#use yii\test\DbTestTrait;
class
UserTest
extends
\
tests\_helpers
\TestCase
class
UserTest
extends
\
yii\codeception
\TestCase
{
{
use
DbTestTrait
;
use
DbTestTrait
;
...
...
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