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
2ca11229
Commit
2ca11229
authored
May 24, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:yiisoft/yii2
parents
61669700
7cd9123c
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
57 additions
and
94 deletions
+57
-94
MysqlTestCase.php
tests/unit/MysqlTestCase.php
+0
-37
TestCase.php
tests/unit/TestCase.php
+1
-1
ApcCacheTest.php
tests/unit/framework/caching/ApcCacheTest.php
+1
-2
CacheTestCase.php
tests/unit/framework/caching/CacheTestCase.php
+2
-2
DbCacheTest.php
tests/unit/framework/caching/DbCacheTest.php
+1
-2
FileCacheTest.php
tests/unit/framework/caching/FileCacheTest.php
+1
-2
MemCacheTest.php
tests/unit/framework/caching/MemCacheTest.php
+1
-2
MemCachedTest.php
tests/unit/framework/caching/MemCachedTest.php
+1
-2
WinCacheTest.php
tests/unit/framework/caching/WinCacheTest.php
+2
-3
XCacheTest.php
tests/unit/framework/caching/XCacheTest.php
+1
-2
ZendDataCacheTest.php
tests/unit/framework/caching/ZendDataCacheTest.php
+2
-2
ActiveRecordTest.php
tests/unit/framework/db/ActiveRecordTest.php
+1
-2
CommandTest.php
tests/unit/framework/db/CommandTest.php
+1
-1
ConnectionTest.php
tests/unit/framework/db/ConnectionTest.php
+1
-1
DatabaseTestCase.php
tests/unit/framework/db/DatabaseTestCase.php
+3
-2
QueryTest.php
tests/unit/framework/db/QueryTest.php
+1
-1
MssqlActiveRecordTest.php
tests/unit/framework/db/mssql/MssqlActiveRecordTest.php
+3
-1
MssqlCommandTest.php
tests/unit/framework/db/mssql/MssqlCommandTest.php
+3
-1
MssqlConnectionTest.php
tests/unit/framework/db/mssql/MssqlConnectionTest.php
+3
-1
MssqlQueryTest.php
tests/unit/framework/db/mssql/MssqlQueryTest.php
+3
-1
SqliteActiveRecordTest.php
tests/unit/framework/db/sqlite/SqliteActiveRecordTest.php
+3
-2
SqliteCommandTest.php
tests/unit/framework/db/sqlite/SqliteCommandTest.php
+3
-2
SqliteConnectionTest.php
tests/unit/framework/db/sqlite/SqliteConnectionTest.php
+3
-2
SqliteQueryTest.php
tests/unit/framework/db/sqlite/SqliteQueryTest.php
+2
-9
ArrayHelperTest.php
tests/unit/framework/helpers/ArrayHelperTest.php
+2
-2
JsonTest.php
tests/unit/framework/helpers/JsonTest.php
+2
-1
StringHelperTest.php
tests/unit/framework/helpers/StringHelperTest.php
+2
-1
VarDumperTest.php
tests/unit/framework/helpers/VarDumperTest.php
+2
-1
ManagerTestCase.php
tests/unit/framework/rbac/ManagerTestCase.php
+1
-1
PhpManagerTest.php
tests/unit/framework/rbac/PhpManagerTest.php
+1
-3
UrlManagerTest.php
tests/unit/framework/web/UrlManagerTest.php
+2
-1
UrlRuleTest.php
tests/unit/framework/web/UrlRuleTest.php
+2
-1
No files found.
tests/unit/MysqlTestCase.php
deleted
100644 → 0
View file @
61669700
<?php
namespace
yiiunit
;
class
MysqlTestCase
extends
TestCase
{
protected
function
setUp
()
{
parent
::
setUp
();
if
(
!
extension_loaded
(
'pdo'
)
||
!
extension_loaded
(
'pdo_mysql'
))
{
$this
->
markTestSkipped
(
'pdo and pdo_mysql extensions are required.'
);
}
}
/**
* @param bool $reset whether to clean up the test database
* @return \yii\db\Connection
*/
public
function
getConnection
(
$reset
=
true
)
{
$params
=
$this
->
getParam
(
'mysql'
);
$db
=
new
\yii\db\Connection
;
$db
->
dsn
=
$params
[
'dsn'
];
$db
->
username
=
$params
[
'username'
];
$db
->
password
=
$params
[
'password'
];
if
(
$reset
)
{
$db
->
open
();
$lines
=
explode
(
';'
,
file_get_contents
(
$params
[
'fixture'
]));
foreach
(
$lines
as
$line
)
{
if
(
trim
(
$line
)
!==
''
)
{
$db
->
pdo
->
exec
(
$line
);
}
}
}
return
$db
;
}
}
tests/unit/TestCase.php
View file @
2ca11229
...
...
@@ -5,7 +5,7 @@ namespace yiiunit;
/**
* This is the base class for all yii framework unit tests.
*/
class
TestCase
extends
\yii\test\TestCase
abstract
class
TestCase
extends
\yii\test\TestCase
{
public
static
$params
;
...
...
tests/unit/framework/caching/ApcCacheTest.php
View file @
2ca11229
<?php
namespace
yiiunit\framework\caching
;
use
yii\caching\ApcCache
;
use
yiiunit\TestCase
;
/**
* Class for testing APC cache backend
*/
class
ApcCacheTest
extends
CacheTest
class
ApcCacheTest
extends
CacheTest
Case
{
private
$_cacheInstance
=
null
;
...
...
tests/unit/framework/caching/CacheTest.php
→
tests/unit/framework/caching/CacheTest
Case
.php
View file @
2ca11229
...
...
@@ -7,7 +7,7 @@ namespace yii\caching;
* @return int
*/
function
time
()
{
return
\yiiunit\framework\caching\CacheTest
::
$time
?:
\time
();
return
\yiiunit\framework\caching\CacheTest
Case
::
$time
?:
\time
();
}
namespace
yiiunit\framework\caching
;
...
...
@@ -18,7 +18,7 @@ use yii\caching\Cache;
/**
* Base class for testing cache backends
*/
abstract
class
CacheTest
extends
TestCase
abstract
class
CacheTest
Case
extends
TestCase
{
/**
* @var int virtual time to be returned by mocked time() function.
...
...
tests/unit/framework/caching/DbCacheTest.php
View file @
2ca11229
...
...
@@ -3,12 +3,11 @@
namespace
yiiunit\framework\caching
;
use
yii\caching\DbCache
;
use
yiiunit\TestCase
;
/**
* Class for testing file cache backend
*/
class
DbCacheTest
extends
CacheTest
class
DbCacheTest
extends
CacheTest
Case
{
private
$_cacheInstance
;
private
$_connection
;
...
...
tests/unit/framework/caching/FileCacheTest.php
View file @
2ca11229
<?php
namespace
yiiunit\framework\caching
;
use
yii\caching\FileCache
;
use
yiiunit\TestCase
;
/**
* Class for testing file cache backend
*/
class
FileCacheTest
extends
CacheTest
class
FileCacheTest
extends
CacheTest
Case
{
private
$_cacheInstance
=
null
;
...
...
tests/unit/framework/caching/MemCacheTest.php
View file @
2ca11229
<?php
namespace
yiiunit\framework\caching
;
use
yii\caching\MemCache
;
use
yiiunit\TestCase
;
/**
* Class for testing memcache cache backend
*/
class
MemCacheTest
extends
CacheTest
class
MemCacheTest
extends
CacheTest
Case
{
private
$_cacheInstance
=
null
;
...
...
tests/unit/framework/caching/MemCachedTest.php
View file @
2ca11229
<?php
namespace
yiiunit\framework\caching
;
use
yii\caching\MemCache
;
use
yiiunit\TestCase
;
/**
* Class for testing memcached cache backend
*/
class
MemCachedTest
extends
CacheTest
class
MemCachedTest
extends
CacheTest
Case
{
private
$_cacheInstance
=
null
;
...
...
tests/unit/framework/caching/WinCacheTest.php
View file @
2ca11229
<?php
namespace
yiiunit\framework\caching
;
use
yii\caching\FileCache
;
use
yiiunit\TestCase
;
use
yii\caching\WinCache
;
/**
* Class for testing wincache backend
*/
class
WinCacheTest
extends
CacheTest
class
WinCacheTest
extends
CacheTest
Case
{
private
$_cacheInstance
=
null
;
...
...
tests/unit/framework/caching/XCacheTest.php
View file @
2ca11229
<?php
namespace
yiiunit\framework\caching
;
use
yii\caching\XCache
;
use
yiiunit\TestCase
;
/**
* Class for testing xcache backend
*/
class
XCacheTest
extends
CacheTest
class
XCacheTest
extends
CacheTest
Case
{
private
$_cacheInstance
=
null
;
...
...
tests/unit/framework/caching/ZendDataCacheTest.php
View file @
2ca11229
<?php
namespace
yiiunit\framework\caching
;
use
yii\caching\Cache
;
use
yii\caching\ZendDataCache
;
use
yiiunit\TestCase
;
/**
* Class for testing Zend cache backend
*/
class
ZendDataCacheTest
extends
CacheTest
class
ZendDataCacheTest
extends
CacheTest
Case
{
private
$_cacheInstance
=
null
;
...
...
tests/unit/framework/db/ActiveRecordTest.php
View file @
2ca11229
<?php
namespace
yiiunit\framework\db
;
use
yii\db\Query
;
...
...
@@ -10,7 +9,7 @@ use yiiunit\data\ar\OrderItem;
use
yiiunit\data\ar\Order
;
use
yiiunit\data\ar\Item
;
class
ActiveRecordTest
extends
\yiiunit\
DatabaseTestCase
class
ActiveRecordTest
extends
DatabaseTestCase
{
protected
function
setUp
()
{
...
...
tests/unit/framework/db/CommandTest.php
View file @
2ca11229
...
...
@@ -7,7 +7,7 @@ use yii\db\Command;
use
yii\db\Query
;
use
yii\db\DataReader
;
class
CommandTest
extends
\yiiunit\
DatabaseTestCase
class
CommandTest
extends
DatabaseTestCase
{
function
testConstruct
()
{
...
...
tests/unit/framework/db/ConnectionTest.php
View file @
2ca11229
...
...
@@ -4,7 +4,7 @@ namespace yiiunit\framework\db;
use
yii\db\Connection
;
class
ConnectionTest
extends
\yiiunit\
DatabaseTestCase
class
ConnectionTest
extends
DatabaseTestCase
{
function
testConstruct
()
{
...
...
tests/unit/DatabaseTestCase.php
→
tests/unit/
framework/db/
DatabaseTestCase.php
View file @
2ca11229
<?php
namespace
yiiunit\framework\db
;
namespace
yiiunit
;
use
yiiunit\TestCase
as
TestCase
;
class
DatabaseTestCase
extends
TestCase
abstract
class
DatabaseTestCase
extends
TestCase
{
protected
$database
;
protected
$driverName
=
'mysql'
;
...
...
tests/unit/framework/db/QueryTest.php
View file @
2ca11229
...
...
@@ -7,7 +7,7 @@ use yii\db\Command;
use
yii\db\Query
;
use
yii\db\DataReader
;
class
QueryTest
extends
\yiiunit\
DatabaseTestCase
class
QueryTest
extends
DatabaseTestCase
{
function
testSelect
()
{
...
...
tests/unit/framework/db/mssql/MssqlActiveRecordTest.php
View file @
2ca11229
...
...
@@ -2,7 +2,9 @@
namespace
yiiunit\framework\db\mssql
;
class
MssqlActiveRecordTest
extends
\yiiunit\framework\db\ActiveRecordTest
use
yiiunit\framework\db\ActiveRecordTest
;
class
MssqlActiveRecordTest
extends
ActiveRecordTest
{
protected
function
setUp
()
{
...
...
tests/unit/framework/db/mssql/MssqlCommandTest.php
View file @
2ca11229
...
...
@@ -2,7 +2,9 @@
namespace
yiiunit\framework\db\mssql
;
class
MssqlCommandTest
extends
\yiiunit\framework\db\CommandTest
use
yiiunit\framework\db\CommandTest
;
class
MssqlCommandTest
extends
CommandTest
{
public
function
setUp
()
{
...
...
tests/unit/framework/db/mssql/MssqlConnectionTest.php
View file @
2ca11229
...
...
@@ -2,7 +2,9 @@
namespace
yiiunit\framework\db\mssql
;
class
MssqlConnectionTest
extends
\yiiunit\framework\db\ConnectionTest
use
yiiunit\framework\db\ConnectionTest
;
class
MssqlConnectionTest
extends
ConnectionTest
{
public
function
setUp
()
{
...
...
tests/unit/framework/db/mssql/MssqlQueryTest.php
View file @
2ca11229
...
...
@@ -2,7 +2,9 @@
namespace
yiiunit\framework\db\mssql
;
class
MssqlQueryTest
extends
\yiiunit\framework\db\QueryTest
use
yiiunit\framework\db\QueryTest
;
class
MssqlQueryTest
extends
QueryTest
{
public
function
setUp
()
{
...
...
tests/unit/framework/db/sqlite/SqliteActiveRecordTest.php
View file @
2ca11229
<?php
namespace
yiiunit\framework\db\sqlite
;
class
SqliteActiveRecordTest
extends
\yiiunit\framework\db\ActiveRecordTest
use
yiiunit\framework\db\ActiveRecordTest
;
class
SqliteActiveRecordTest
extends
ActiveRecordTest
{
protected
function
setUp
()
{
...
...
tests/unit/framework/db/sqlite/SqliteCommandTest.php
View file @
2ca11229
<?php
namespace
yiiunit\framework\db\sqlite
;
class
SqliteCommandTest
extends
\yiiunit\framework\db\CommandTest
use
yiiunit\framework\db\CommandTest
;
class
SqliteCommandTest
extends
CommandTest
{
protected
function
setUp
()
{
...
...
tests/unit/framework/db/sqlite/SqliteConnectionTest.php
View file @
2ca11229
<?php
namespace
yiiunit\framework\db\sqlite
;
class
SqliteConnectionTest
extends
\yiiunit\framework\db\ConnectionTest
use
yiiunit\framework\db\ConnectionTest
;
class
SqliteConnectionTest
extends
ConnectionTest
{
protected
function
setUp
()
{
...
...
tests/unit/framework/db/sqlite/SqliteQueryTest.php
View file @
2ca11229
<?php
/**
* Created by JetBrains PhpStorm.
* User: RusMaxim
* Date: 09.05.13
* Time: 21:41
* To change this template use File | Settings | File Templates.
*/
namespace
yiiunit\framework\db\sqlite
;
use
yiiunit\framework\db\QueryTest
;
class
SqliteQueryTest
extends
\yiiunit\framework\db\
QueryTest
class
SqliteQueryTest
extends
QueryTest
{
protected
function
setUp
()
{
...
...
tests/unit/framework/helpers/ArrayHelperTest.php
View file @
2ca11229
...
...
@@ -3,10 +3,10 @@
namespace
yiiunit\framework\helpers
;
use
yii\helpers\ArrayHelper
;
use
yii\
helpers\VarDumper
;
use
yii\
test\TestCase
;
use
yii\web\Sort
;
class
ArrayHelperTest
extends
\yii\test\
TestCase
class
ArrayHelperTest
extends
TestCase
{
public
function
testMerge
()
{
...
...
tests/unit/framework/helpers/JsonTest.php
View file @
2ca11229
...
...
@@ -4,9 +4,10 @@
namespace
yiiunit\framework\helpers
;
use
yii\helpers\Json
;
use
yii\test\TestCase
;
use
yii\web\JsExpression
;
class
JsonTest
extends
\yii\test\
TestCase
class
JsonTest
extends
TestCase
{
public
function
testEncode
()
{
...
...
tests/unit/framework/helpers/StringHelperTest.php
View file @
2ca11229
<?php
namespace
yiiunit\framework\helpers
;
use
\yii\helpers\StringHelper
as
StringHelper
;
use
yii\test\TestCase
;
/**
* StringHelperTest
*/
class
StringHelperTest
extends
\yii\test\
TestCase
class
StringHelperTest
extends
TestCase
{
public
function
testStrlen
()
{
...
...
tests/unit/framework/helpers/VarDumperTest.php
View file @
2ca11229
<?php
namespace
yiiunit\framework\helpers
;
use
\yii\helpers\VarDumper
;
use
yii\test\TestCase
;
class
VarDumperTest
extends
\yii\test\
TestCase
class
VarDumperTest
extends
TestCase
{
public
function
testDumpObject
()
{
...
...
tests/unit/framework/rbac/ManagerTest
B
ase.php
→
tests/unit/framework/rbac/ManagerTest
C
ase.php
View file @
2ca11229
...
...
@@ -6,7 +6,7 @@ use yii\rbac\Assignment;
use
yii\rbac\Item
;
use
yiiunit\TestCase
;
abstract
class
ManagerTest
B
ase
extends
TestCase
abstract
class
ManagerTest
C
ase
extends
TestCase
{
/** @var \yii\rbac\PhpManager|\yii\rbac\DbManager */
protected
$auth
;
...
...
tests/unit/framework/rbac/PhpManagerTest.php
View file @
2ca11229
...
...
@@ -5,9 +5,7 @@ namespace yiiunit\framework\rbac;
use
Yii
;
use
yii\rbac\PhpManager
;
//require_once(__DIR__ . '/ManagerTestBase.php');
class
PhpManagerTest
extends
ManagerTestBase
class
PhpManagerTest
extends
ManagerTestCase
{
protected
function
setUp
()
{
...
...
tests/unit/framework/web/UrlManagerTest.php
View file @
2ca11229
...
...
@@ -3,8 +3,9 @@ namespace yiiunit\framework\web;
use
yii\web\Request
;
use
yii\web\UrlManager
;
use
yiiunit\TestCase
;
class
UrlManagerTest
extends
\yiiunit\
TestCase
class
UrlManagerTest
extends
TestCase
{
public
function
testCreateUrl
()
{
...
...
tests/unit/framework/web/UrlRuleTest.php
View file @
2ca11229
...
...
@@ -5,8 +5,9 @@ namespace yiiunit\framework\web;
use
yii\web\UrlManager
;
use
yii\web\UrlRule
;
use
yii\web\Request
;
use
yiiunit\TestCase
;
class
UrlRuleTest
extends
\yiiunit\
TestCase
class
UrlRuleTest
extends
TestCase
{
public
function
testCreateUrl
()
{
...
...
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