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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
8c1c3c59
Commit
8c1c3c59
authored
Oct 15, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better AR connection init in tests
parent
5cf99922
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
11 deletions
+2
-11
DatabaseTestCase.php
tests/unit/framework/db/DatabaseTestCase.php
+0
-4
ExistValidatorTest.php
tests/unit/framework/validators/ExistValidatorTest.php
+1
-6
UniqueValidatorTest.php
tests/unit/framework/validators/UniqueValidatorTest.php
+1
-1
No files found.
tests/unit/framework/db/DatabaseTestCase.php
View file @
8c1c3c59
...
...
@@ -12,7 +12,6 @@ abstract class DatabaseTestCase extends TestCase
* @var Connection
*/
protected
$db
;
protected
$initializeAppWithDb
=
false
;
protected
function
setUp
()
{
...
...
@@ -24,9 +23,6 @@ abstract class DatabaseTestCase extends TestCase
if
(
!
extension_loaded
(
'pdo'
)
||
!
extension_loaded
(
$pdo_database
))
{
$this
->
markTestSkipped
(
'pdo and '
.
$pdo_database
.
' extension are required.'
);
}
if
(
$this
->
initializeAppWithDb
===
true
)
{
\Yii
::
$app
->
setComponent
(
'db'
,
$this
->
getConnection
());
}
$this
->
mockApplication
();
}
...
...
tests/unit/framework/validators/ExistValidatorTest.php
View file @
8c1c3c59
...
...
@@ -19,12 +19,7 @@ class ExistValidatorTest extends DatabaseTestCase
public
function
setUp
()
{
parent
::
setUp
();
ActiveRecord
::
$db
=
Yii
::
$app
->
getComponent
(
'db'
);
}
public
function
tearDown
()
{
parent
::
tearDown
();
ActiveRecord
::
$db
=
$this
->
getConnection
();
}
public
function
testValidateValueExpectedException
()
...
...
tests/unit/framework/validators/UniqueValidatorTest.php
View file @
8c1c3c59
...
...
@@ -20,7 +20,7 @@ class UniqueValidatorTest extends DatabaseTestCase
public
function
setUp
()
{
parent
::
setUp
();
ActiveRecord
::
$db
=
Yii
::
$app
->
getComponent
(
'db'
);
ActiveRecord
::
$db
=
$this
->
getConnection
(
);
}
public
function
testAssureMessageSetOnInit
()
...
...
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