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
32d07689
Commit
32d07689
authored
11 years ago
by
AlexGx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style fixes with phpcs:yii2
parent
34db2d20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
103 changed files
with
313 additions
and
266 deletions
+313
-266
TestCase.php
tests/unit/TestCase.php
+1
-0
Customer.php
tests/unit/data/ar/Customer.php
+1
-1
CustomerQuery.php
tests/unit/data/ar/CustomerQuery.php
+2
-2
Profile.php
tests/unit/data/ar/Profile.php
+1
-3
CustomerQuery.php
tests/unit/data/ar/elasticsearch/CustomerQuery.php
+2
-2
Item.php
tests/unit/data/ar/elasticsearch/Item.php
+1
-0
Order.php
tests/unit/data/ar/elasticsearch/Order.php
+1
-0
OrderItem.php
tests/unit/data/ar/elasticsearch/OrderItem.php
+1
-0
ActiveRecord.php
tests/unit/data/ar/mongodb/ActiveRecord.php
+1
-2
Customer.php
tests/unit/data/ar/mongodb/Customer.php
+1
-2
CustomerOrder.php
tests/unit/data/ar/mongodb/CustomerOrder.php
+1
-2
CustomerQuery.php
tests/unit/data/ar/mongodb/CustomerQuery.php
+2
-2
ActiveRecord.php
tests/unit/data/ar/mongodb/file/ActiveRecord.php
+1
-2
CustomerFile.php
tests/unit/data/ar/mongodb/file/CustomerFile.php
+1
-2
CustomerFileQuery.php
tests/unit/data/ar/mongodb/file/CustomerFileQuery.php
+2
-2
ActiveRecord.php
tests/unit/data/ar/redis/ActiveRecord.php
+1
-2
CustomerQuery.php
tests/unit/data/ar/redis/CustomerQuery.php
+2
-2
Item.php
tests/unit/data/ar/redis/Item.php
+1
-2
Order.php
tests/unit/data/ar/redis/Order.php
+1
-1
OrderItem.php
tests/unit/data/ar/redis/OrderItem.php
+1
-2
ActiveRecord.php
tests/unit/data/ar/sphinx/ActiveRecord.php
+1
-2
ArticleDb.php
tests/unit/data/ar/sphinx/ArticleDb.php
+1
-2
ArticleIndex.php
tests/unit/data/ar/sphinx/ArticleIndex.php
+1
-2
ArticleIndexQuery.php
tests/unit/data/ar/sphinx/ArticleIndexQuery.php
+2
-2
ItemDb.php
tests/unit/data/ar/sphinx/ItemDb.php
+1
-2
ItemIndex.php
tests/unit/data/ar/sphinx/ItemIndex.php
+1
-2
RuntimeIndex.php
tests/unit/data/ar/sphinx/RuntimeIndex.php
+1
-2
TagDb.php
tests/unit/data/ar/sphinx/TagDb.php
+1
-2
test.php
tests/unit/data/i18n/messages/de-DE/test.php
+1
-2
test.php
tests/unit/data/i18n/messages/de/test.php
+1
-2
test.php
tests/unit/data/i18n/messages/en-US/test.php
+1
-2
test.php
tests/unit/data/i18n/messages/ru/test.php
+1
-2
TestValidator.php
tests/unit/data/validators/TestValidator.php
+1
-2
ValidatorTestMainModel.php
tests/unit/data/validators/models/ValidatorTestMainModel.php
+1
-2
ValidatorTestRefModel.php
tests/unit/data/validators/models/ValidatorTestRefModel.php
+1
-2
AuthActionTest.php
tests/unit/extensions/authclient/AuthActionTest.php
+1
-2
BaseClientTest.php
tests/unit/extensions/authclient/BaseClientTest.php
+1
-2
CollectionTest.php
tests/unit/extensions/authclient/CollectionTest.php
+1
-2
OAuth1Test.php
tests/unit/extensions/authclient/OAuth1Test.php
+2
-1
OpenIdTest.php
tests/unit/extensions/authclient/OpenIdTest.php
+1
-2
TokenTest.php
tests/unit/extensions/authclient/TokenTest.php
+1
-2
BaseMethodTest.php
...s/unit/extensions/authclient/signature/BaseMethodTest.php
+1
-2
HmacSha1Test.php
tests/unit/extensions/authclient/signature/HmacSha1Test.php
+1
-2
PlainTextTest.php
tests/unit/extensions/authclient/signature/PlainTextTest.php
+1
-2
RsaSha1Test.php
tests/unit/extensions/authclient/signature/RsaSha1Test.php
+1
-2
ActiveRecordTest.php
tests/unit/extensions/elasticsearch/ActiveRecordTest.php
+40
-11
ElasticSearchConnectionTest.php
.../extensions/elasticsearch/ElasticSearchConnectionTest.php
+1
-3
QueryBuilderTest.php
tests/unit/extensions/elasticsearch/QueryBuilderTest.php
+0
-1
ImageGdTest.php
tests/unit/extensions/imagine/ImageGdTest.php
+0
-1
ImageGmagickTest.php
tests/unit/extensions/imagine/ImageGmagickTest.php
+0
-1
ImageImagickTest.php
tests/unit/extensions/imagine/ImageImagickTest.php
+0
-1
ActiveDataProviderTest.php
tests/unit/extensions/mongodb/ActiveDataProviderTest.php
+1
-2
ActiveRecordTest.php
tests/unit/extensions/mongodb/ActiveRecordTest.php
+1
-2
CacheTest.php
tests/unit/extensions/mongodb/CacheTest.php
+1
-2
CollectionTest.php
tests/unit/extensions/mongodb/CollectionTest.php
+1
-2
ConnectionTest.php
tests/unit/extensions/mongodb/ConnectionTest.php
+1
-2
DatabaseTest.php
tests/unit/extensions/mongodb/DatabaseTest.php
+1
-2
QueryRunTest.php
tests/unit/extensions/mongodb/QueryRunTest.php
+1
-2
QueryTest.php
tests/unit/extensions/mongodb/QueryTest.php
+1
-2
SessionTest.php
tests/unit/extensions/mongodb/SessionTest.php
+1
-2
ActiveRecordTest.php
tests/unit/extensions/mongodb/file/ActiveRecordTest.php
+1
-2
CollectionTest.php
tests/unit/extensions/mongodb/file/CollectionTest.php
+1
-2
QueryTest.php
tests/unit/extensions/mongodb/file/QueryTest.php
+1
-2
ActiveRecordTest.php
tests/unit/extensions/redis/ActiveRecordTest.php
+39
-9
RedisCacheTest.php
tests/unit/extensions/redis/RedisCacheTest.php
+0
-1
ViewRendererTest.php
tests/unit/extensions/smarty/ViewRendererTest.php
+1
-2
ActiveDataProviderTest.php
tests/unit/extensions/sphinx/ActiveDataProviderTest.php
+1
-2
ActiveRecordTest.php
tests/unit/extensions/sphinx/ActiveRecordTest.php
+1
-2
ColumnSchemaTest.php
tests/unit/extensions/sphinx/ColumnSchemaTest.php
+1
-2
CommandTest.php
tests/unit/extensions/sphinx/CommandTest.php
+3
-4
ConnectionTest.php
tests/unit/extensions/sphinx/ConnectionTest.php
+1
-2
QueryTest.php
tests/unit/extensions/sphinx/QueryTest.php
+2
-3
SchemaTest.php
tests/unit/extensions/sphinx/SchemaTest.php
+1
-2
ViewRendererTest.php
tests/unit/extensions/twig/ViewRendererTest.php
+1
-2
ActiveRecordTestTrait.php
tests/unit/framework/ar/ActiveRecordTestTrait.php
+8
-8
BehaviorTest.php
tests/unit/framework/base/BehaviorTest.php
+0
-1
EventTest.php
tests/unit/framework/base/EventTest.php
+0
-1
ActiveRecordTest.php
tests/unit/framework/db/ActiveRecordTest.php
+39
-9
QueryBuilderTest.php
tests/unit/framework/db/QueryBuilderTest.php
+0
-1
CubridQueryBuilderTest.php
tests/unit/framework/db/cubrid/CubridQueryBuilderTest.php
+0
-1
MssqlQueryBuilderTest.php
tests/unit/framework/db/mssql/MssqlQueryBuilderTest.php
+43
-47
SqliteQueryBuilderTest.php
tests/unit/framework/db/sqlite/SqliteQueryBuilderTest.php
+1
-1
FileHelperTest.php
tests/unit/framework/helpers/FileHelperTest.php
+17
-7
HtmlTest.php
tests/unit/framework/helpers/HtmlTest.php
+1
-1
FallbackMessageFormatterTest.php
tests/unit/framework/i18n/FallbackMessageFormatterTest.php
+1
-1
I18NTest.php
tests/unit/framework/i18n/I18NTest.php
+2
-3
LoggerTest.php
tests/unit/framework/log/LoggerTest.php
+1
-2
TargetTest.php
tests/unit/framework/log/TargetTest.php
+1
-2
BaseMailerTest.php
tests/unit/framework/mail/BaseMailerTest.php
+2
-3
BaseMessageTest.php
tests/unit/framework/mail/BaseMessageTest.php
+33
-10
CompareValidatorTest.php
tests/unit/framework/validators/CompareValidatorTest.php
+0
-2
DateValidatorTest.php
tests/unit/framework/validators/DateValidatorTest.php
+0
-1
DefaultValueValidatorTest.php
...s/unit/framework/validators/DefaultValueValidatorTest.php
+2
-0
ExistValidatorPostgresTest.php
.../ExistValidatorDriverTests/ExistValidatorPostgresTest.php
+1
-2
ExistValidatorSQliteTest.php
...rs/ExistValidatorDriverTests/ExistValidatorSQliteTest.php
+1
-2
FilterValidatorTest.php
tests/unit/framework/validators/FilterValidatorTest.php
+1
-2
NumberValidatorTest.php
tests/unit/framework/validators/NumberValidatorTest.php
+1
-1
RegularExpressionValidatorTest.php
...t/framework/validators/RegularExpressionValidatorTest.php
+0
-1
UniqueValidatorPostgresTest.php
...niqueValidatorDriverTests/UniqueValidatorPostgresTest.php
+1
-2
UniqueValidatorSQliteTest.php
.../UniqueValidatorDriverTests/UniqueValidatorSQliteTest.php
+1
-2
UrlValidatorTest.php
tests/unit/framework/validators/UrlValidatorTest.php
+0
-0
AssetBundleTest.php
tests/unit/framework/web/AssetBundleTest.php
+0
-0
AssetConverterTest.php
tests/unit/framework/web/AssetConverterTest.php
+0
-0
No files found.
tests/unit/TestCase.php
View file @
32d07689
<?php
<?php
namespace
yiiunit
;
namespace
yiiunit
;
use
yii\helpers\ArrayHelper
;
use
yii\helpers\ArrayHelper
;
/**
/**
...
...
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/Customer.php
View file @
32d07689
...
@@ -48,7 +48,7 @@ class Customer extends ActiveRecord
...
@@ -48,7 +48,7 @@ class Customer extends ActiveRecord
{
{
/** @var ActiveQuery $rel */
/** @var ActiveQuery $rel */
$rel
=
$this
->
hasMany
(
Item
::
className
(),
[
'id'
=>
'item_id'
]);
$rel
=
$this
->
hasMany
(
Item
::
className
(),
[
'id'
=>
'item_id'
]);
return
$rel
->
viaTable
(
'tbl_order_item'
,
[
'order_id'
=>
'id'
],
function
(
$q
)
{
return
$rel
->
viaTable
(
'tbl_order_item'
,
[
'order_id'
=>
'id'
],
function
(
$q
)
{
/** @var ActiveQuery $q */
/** @var ActiveQuery $q */
$q
->
viaTable
(
'tbl_order'
,
[
'customer_id'
=>
'id'
]);
$q
->
viaTable
(
'tbl_order'
,
[
'customer_id'
=>
'id'
]);
})
->
orderBy
(
'id'
);
})
->
orderBy
(
'id'
);
...
...
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/CustomerQuery.php
View file @
32d07689
<?php
<?php
namespace
yiiunit\data\ar
;
namespace
yiiunit\data\ar
;
use
yii\db\ActiveQuery
;
use
yii\db\ActiveQuery
;
/**
/**
...
@@ -13,4 +15,3 @@ class CustomerQuery extends ActiveQuery
...
@@ -13,4 +15,3 @@ class CustomerQuery extends ActiveQuery
return
$this
;
return
$this
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/Profile.php
View file @
32d07689
...
@@ -18,5 +18,4 @@ class Profile extends ActiveRecord
...
@@ -18,5 +18,4 @@ class Profile extends ActiveRecord
{
{
return
'tbl_profile'
;
return
'tbl_profile'
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/elasticsearch/CustomerQuery.php
View file @
32d07689
<?php
<?php
namespace
yiiunit\data\ar\elasticsearch
;
namespace
yiiunit\data\ar\elasticsearch
;
use
yii\elasticsearch\ActiveQuery
;
use
yii\elasticsearch\ActiveQuery
;
/**
/**
...
@@ -13,4 +15,3 @@ class CustomerQuery extends ActiveQuery
...
@@ -13,4 +15,3 @@ class CustomerQuery extends ActiveQuery
return
$this
;
return
$this
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/elasticsearch/Item.php
View file @
32d07689
<?php
<?php
namespace
yiiunit\data\ar\elasticsearch
;
namespace
yiiunit\data\ar\elasticsearch
;
use
yii\elasticsearch\Command
;
use
yii\elasticsearch\Command
;
/**
/**
...
...
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/elasticsearch/Order.php
View file @
32d07689
<?php
<?php
namespace
yiiunit\data\ar\elasticsearch
;
namespace
yiiunit\data\ar\elasticsearch
;
use
yii\elasticsearch\Command
;
use
yii\elasticsearch\Command
;
/**
/**
...
...
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/elasticsearch/OrderItem.php
View file @
32d07689
<?php
<?php
namespace
yiiunit\data\ar\elasticsearch
;
namespace
yiiunit\data\ar\elasticsearch
;
use
yii\elasticsearch\Command
;
use
yii\elasticsearch\Command
;
/**
/**
...
...
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/mongodb/ActiveRecord.php
View file @
32d07689
...
@@ -13,4 +13,4 @@ class ActiveRecord extends \yii\mongodb\ActiveRecord
...
@@ -13,4 +13,4 @@ class ActiveRecord extends \yii\mongodb\ActiveRecord
{
{
return
self
::
$db
;
return
self
::
$db
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/mongodb/Customer.php
View file @
32d07689
...
@@ -30,4 +30,4 @@ class Customer extends ActiveRecord
...
@@ -30,4 +30,4 @@ class Customer extends ActiveRecord
$config
[
'modelClass'
]
=
get_called_class
();
$config
[
'modelClass'
]
=
get_called_class
();
return
new
CustomerQuery
(
$config
);
return
new
CustomerQuery
(
$config
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/mongodb/CustomerOrder.php
View file @
32d07689
...
@@ -24,4 +24,4 @@ class CustomerOrder extends ActiveRecord
...
@@ -24,4 +24,4 @@ class CustomerOrder extends ActiveRecord
{
{
return
$this
->
hasOne
(
Customer
::
className
(),
[
'_id'
=>
'customer_id'
]);
return
$this
->
hasOne
(
Customer
::
className
(),
[
'_id'
=>
'customer_id'
]);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/mongodb/CustomerQuery.php
View file @
32d07689
<?php
<?php
namespace
yiiunit\data\ar\mongodb
;
namespace
yiiunit\data\ar\mongodb
;
use
yii\mongodb\ActiveQuery
;
use
yii\mongodb\ActiveQuery
;
/**
/**
...
@@ -13,4 +15,3 @@ class CustomerQuery extends ActiveQuery
...
@@ -13,4 +15,3 @@ class CustomerQuery extends ActiveQuery
return
$this
;
return
$this
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/mongodb/file/ActiveRecord.php
View file @
32d07689
...
@@ -13,4 +13,4 @@ class ActiveRecord extends \yii\mongodb\file\ActiveRecord
...
@@ -13,4 +13,4 @@ class ActiveRecord extends \yii\mongodb\file\ActiveRecord
{
{
return
self
::
$db
;
return
self
::
$db
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/mongodb/file/CustomerFile.php
View file @
32d07689
...
@@ -25,4 +25,4 @@ class CustomerFile extends ActiveRecord
...
@@ -25,4 +25,4 @@ class CustomerFile extends ActiveRecord
$config
[
'modelClass'
]
=
get_called_class
();
$config
[
'modelClass'
]
=
get_called_class
();
return
new
CustomerFileQuery
(
$config
);
return
new
CustomerFileQuery
(
$config
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/mongodb/file/CustomerFileQuery.php
View file @
32d07689
<?php
<?php
namespace
yiiunit\data\ar\mongodb\file
;
namespace
yiiunit\data\ar\mongodb\file
;
use
yii\mongodb\file\ActiveQuery
;
use
yii\mongodb\file\ActiveQuery
;
/**
/**
...
@@ -13,4 +15,3 @@ class CustomerFileQuery extends ActiveQuery
...
@@ -13,4 +15,3 @@ class CustomerFileQuery extends ActiveQuery
return
$this
;
return
$this
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/redis/ActiveRecord.php
View file @
32d07689
...
@@ -21,4 +21,4 @@ class ActiveRecord extends \yii\redis\ActiveRecord
...
@@ -21,4 +21,4 @@ class ActiveRecord extends \yii\redis\ActiveRecord
{
{
return
self
::
$db
;
return
self
::
$db
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/redis/CustomerQuery.php
View file @
32d07689
<?php
<?php
namespace
yiiunit\data\ar\redis
;
namespace
yiiunit\data\ar\redis
;
use
yii\redis\ActiveQuery
;
use
yii\redis\ActiveQuery
;
/**
/**
...
@@ -13,4 +15,3 @@ class CustomerQuery extends ActiveQuery
...
@@ -13,4 +15,3 @@ class CustomerQuery extends ActiveQuery
return
$this
;
return
$this
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/redis/Item.php
View file @
32d07689
...
@@ -8,4 +8,4 @@ class Item extends ActiveRecord
...
@@ -8,4 +8,4 @@ class Item extends ActiveRecord
{
{
return
[
'id'
,
'name'
,
'category_id'
];
return
[
'id'
,
'name'
,
'category_id'
];
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/redis/Order.php
View file @
32d07689
...
@@ -22,7 +22,7 @@ class Order extends ActiveRecord
...
@@ -22,7 +22,7 @@ class Order extends ActiveRecord
public
function
getItems
()
public
function
getItems
()
{
{
return
$this
->
hasMany
(
Item
::
className
(),
[
'id'
=>
'item_id'
])
return
$this
->
hasMany
(
Item
::
className
(),
[
'id'
=>
'item_id'
])
->
via
(
'orderItems'
,
function
(
$q
)
{
->
via
(
'orderItems'
,
function
(
$q
)
{
// additional query configuration
// additional query configuration
});
});
}
}
...
...
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/redis/OrderItem.php
View file @
32d07689
...
@@ -23,4 +23,4 @@ class OrderItem extends ActiveRecord
...
@@ -23,4 +23,4 @@ class OrderItem extends ActiveRecord
{
{
return
$this
->
hasOne
(
Item
::
className
(),
[
'id'
=>
'item_id'
]);
return
$this
->
hasOne
(
Item
::
className
(),
[
'id'
=>
'item_id'
]);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/sphinx/ActiveRecord.php
View file @
32d07689
...
@@ -13,4 +13,4 @@ class ActiveRecord extends \yii\sphinx\ActiveRecord
...
@@ -13,4 +13,4 @@ class ActiveRecord extends \yii\sphinx\ActiveRecord
{
{
return
self
::
$db
;
return
self
::
$db
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/sphinx/ArticleDb.php
View file @
32d07689
...
@@ -22,4 +22,4 @@ class ArticleDb extends ActiveRecordDb
...
@@ -22,4 +22,4 @@ class ArticleDb extends ActiveRecordDb
];
];
return
new
ActiveQuery
(
$config
);
return
new
ActiveQuery
(
$config
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/sphinx/ArticleIndex.php
View file @
32d07689
...
@@ -30,4 +30,4 @@ class ArticleIndex extends ActiveRecord
...
@@ -30,4 +30,4 @@ class ArticleIndex extends ActiveRecord
$config
[
'modelClass'
]
=
get_called_class
();
$config
[
'modelClass'
]
=
get_called_class
();
return
new
ArticleIndexQuery
(
$config
);
return
new
ArticleIndexQuery
(
$config
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/sphinx/ArticleIndexQuery.php
View file @
32d07689
<?php
<?php
namespace
yiiunit\data\ar\sphinx
;
namespace
yiiunit\data\ar\sphinx
;
use
yii\sphinx\ActiveQuery
;
use
yii\sphinx\ActiveQuery
;
/**
/**
...
@@ -13,4 +15,3 @@ class ArticleIndexQuery extends ActiveQuery
...
@@ -13,4 +15,3 @@ class ArticleIndexQuery extends ActiveQuery
return
$this
;
return
$this
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/sphinx/ItemDb.php
View file @
32d07689
...
@@ -10,4 +10,4 @@ class ItemDb extends ActiveRecordDb
...
@@ -10,4 +10,4 @@ class ItemDb extends ActiveRecordDb
{
{
return
'yii2_test_item'
;
return
'yii2_test_item'
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/sphinx/ItemIndex.php
View file @
32d07689
...
@@ -8,4 +8,4 @@ class ItemIndex extends ActiveRecord
...
@@ -8,4 +8,4 @@ class ItemIndex extends ActiveRecord
{
{
return
'yii2_test_item_index'
;
return
'yii2_test_item_index'
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/sphinx/RuntimeIndex.php
View file @
32d07689
...
@@ -8,4 +8,4 @@ class RuntimeIndex extends ActiveRecord
...
@@ -8,4 +8,4 @@ class RuntimeIndex extends ActiveRecord
{
{
return
'yii2_test_rt_index'
;
return
'yii2_test_rt_index'
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/ar/sphinx/TagDb.php
View file @
32d07689
...
@@ -9,4 +9,4 @@ class TagDb extends ActiveRecordDb
...
@@ -9,4 +9,4 @@ class TagDb extends ActiveRecordDb
{
{
return
'yii2_test_tag'
;
return
'yii2_test_tag'
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/i18n/messages/de-DE/test.php
View file @
32d07689
...
@@ -6,4 +6,4 @@ return [
...
@@ -6,4 +6,4 @@ return [
'The dog runs fast.'
=>
'Der Hund rennt schnell.'
,
'The dog runs fast.'
=>
'Der Hund rennt schnell.'
,
'His speed is about {n} km/h.'
=>
'Seine Geschwindigkeit beträgt {n} km/h.'
,
'His speed is about {n} km/h.'
=>
'Seine Geschwindigkeit beträgt {n} km/h.'
,
'His name is {name} and his speed is about {n, number} km/h.'
=>
'Er heißt {name} und ist {n, number} km/h schnell.'
,
'His name is {name} and his speed is about {n, number} km/h.'
=>
'Er heißt {name} und ist {n, number} km/h schnell.'
,
];
];
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/i18n/messages/de/test.php
View file @
32d07689
...
@@ -4,4 +4,4 @@
...
@@ -4,4 +4,4 @@
*/
*/
return
[
return
[
'Hello world!'
=>
'Hallo Welt!'
,
'Hello world!'
=>
'Hallo Welt!'
,
];
];
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/i18n/messages/en-US/test.php
View file @
32d07689
...
@@ -4,4 +4,4 @@
...
@@ -4,4 +4,4 @@
*/
*/
return
[
return
[
'The dog runs fast.'
=>
'Der Hund rennt schell.'
,
'The dog runs fast.'
=>
'Der Hund rennt schell.'
,
];
];
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/i18n/messages/ru/test.php
View file @
32d07689
...
@@ -4,4 +4,4 @@
...
@@ -4,4 +4,4 @@
*/
*/
return
[
return
[
'The dog runs fast.'
=>
'Собака бегает быстро.'
,
'The dog runs fast.'
=>
'Собака бегает быстро.'
,
];
];
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/validators/TestValidator.php
View file @
32d07689
...
@@ -41,4 +41,4 @@ class TestValidator extends Validator
...
@@ -41,4 +41,4 @@ class TestValidator extends Validator
{
{
$this
->
_setErrorOnValidateAttribute
=
true
;
$this
->
_setErrorOnValidateAttribute
=
true
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/validators/models/ValidatorTestMainModel.php
View file @
32d07689
...
@@ -18,4 +18,4 @@ class ValidatorTestMainModel extends ActiveRecord
...
@@ -18,4 +18,4 @@ class ValidatorTestMainModel extends ActiveRecord
{
{
return
$this
->
hasMany
(
ValidatorTestRefModel
::
className
(),
[
'ref'
=>
'id'
]);
return
$this
->
hasMany
(
ValidatorTestRefModel
::
className
(),
[
'ref'
=>
'id'
]);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/data/validators/models/ValidatorTestRefModel.php
View file @
32d07689
...
@@ -20,4 +20,4 @@ class ValidatorTestRefModel extends ActiveRecord
...
@@ -20,4 +20,4 @@ class ValidatorTestRefModel extends ActiveRecord
{
{
return
$this
->
hasOne
(
ValidatorTestMainModel
::
className
(),
[
'id'
=>
'ref'
]);
return
$this
->
hasOne
(
ValidatorTestMainModel
::
className
(),
[
'id'
=>
'ref'
]);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/authclient/AuthActionTest.php
View file @
32d07689
...
@@ -65,4 +65,4 @@ class AuthActionTest extends TestCase
...
@@ -65,4 +65,4 @@ class AuthActionTest extends TestCase
$this
->
assertContains
(
$url
,
$response
->
content
);
$this
->
assertContains
(
$url
,
$response
->
content
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/authclient/BaseClientTest.php
View file @
32d07689
...
@@ -79,4 +79,4 @@ class BaseClientTest extends TestCase
...
@@ -79,4 +79,4 @@ class BaseClientTest extends TestCase
class
Client
extends
BaseClient
class
Client
extends
BaseClient
{
{
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/authclient/CollectionTest.php
View file @
32d07689
...
@@ -81,4 +81,4 @@ class CollectionTest extends TestCase
...
@@ -81,4 +81,4 @@ class CollectionTest extends TestCase
class
TestClient
extends
BaseClient
class
TestClient
extends
BaseClient
{
{
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/authclient/OAuth1Test.php
View file @
32d07689
...
@@ -100,7 +100,8 @@ class OAuth1Test extends TestCase
...
@@ -100,7 +100,8 @@ class OAuth1Test extends TestCase
$this
->
assertEquals
(
$expectedAuthorizationHeader
,
$authorizationHeader
);
$this
->
assertEquals
(
$expectedAuthorizationHeader
,
$authorizationHeader
);
}
}
public
function
testBuildAuthUrl
()
{
public
function
testBuildAuthUrl
()
{
$oauthClient
=
new
OAuth1
();
$oauthClient
=
new
OAuth1
();
$authUrl
=
'http://test.auth.url'
;
$authUrl
=
'http://test.auth.url'
;
$oauthClient
->
authUrl
=
$authUrl
;
$oauthClient
->
authUrl
=
$authUrl
;
...
...
This diff is collapsed.
Click to expand it.
tests/unit/extensions/authclient/OpenIdTest.php
View file @
32d07689
...
@@ -58,4 +58,4 @@ class OpenIdTest extends TestCase
...
@@ -58,4 +58,4 @@ class OpenIdTest extends TestCase
$this
->
assertArrayHasKey
(
'ax'
,
$info
);
$this
->
assertArrayHasKey
(
'ax'
,
$info
);
$this
->
assertArrayHasKey
(
'sreg'
,
$info
);
$this
->
assertArrayHasKey
(
'sreg'
,
$info
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/authclient/TokenTest.php
View file @
32d07689
...
@@ -130,4 +130,4 @@ class TokenTest extends TestCase
...
@@ -130,4 +130,4 @@ class TokenTest extends TestCase
$oauthToken
->
createTimestamp
=
$oauthToken
->
createTimestamp
-
(
$expireDuration
+
1
);
$oauthToken
->
createTimestamp
=
$oauthToken
->
createTimestamp
-
(
$expireDuration
+
1
);
$this
->
assertFalse
(
$oauthToken
->
getIsValid
(),
'Expired token is valid!'
);
$this
->
assertFalse
(
$oauthToken
->
getIsValid
(),
'Expired token is valid!'
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/authclient/signature/BaseMethodTest.php
View file @
32d07689
...
@@ -47,4 +47,4 @@ class BaseMethodTest extends TestCase
...
@@ -47,4 +47,4 @@ class BaseMethodTest extends TestCase
$generatedSignature
=
$signatureMethod
->
generateSignature
(
$baseString
,
$key
);
$generatedSignature
=
$signatureMethod
->
generateSignature
(
$baseString
,
$key
);
$this
->
assertTrue
(
$signatureMethod
->
verify
(
$generatedSignature
,
$baseString
,
$key
),
'Generated signature is invalid!'
);
$this
->
assertTrue
(
$signatureMethod
->
verify
(
$generatedSignature
,
$baseString
,
$key
),
'Generated signature is invalid!'
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/authclient/signature/HmacSha1Test.php
View file @
32d07689
...
@@ -17,4 +17,4 @@ class HmacSha1Test extends TestCase
...
@@ -17,4 +17,4 @@ class HmacSha1Test extends TestCase
$signature
=
$signatureMethod
->
generateSignature
(
$baseString
,
$key
);
$signature
=
$signatureMethod
->
generateSignature
(
$baseString
,
$key
);
$this
->
assertNotEmpty
(
$signature
,
'Unable to generate signature!'
);
$this
->
assertNotEmpty
(
$signature
,
'Unable to generate signature!'
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/authclient/signature/PlainTextTest.php
View file @
32d07689
...
@@ -17,4 +17,4 @@ class PlainTextTest extends TestCase
...
@@ -17,4 +17,4 @@ class PlainTextTest extends TestCase
$signature
=
$signatureMethod
->
generateSignature
(
$baseString
,
$key
);
$signature
=
$signatureMethod
->
generateSignature
(
$baseString
,
$key
);
$this
->
assertNotEmpty
(
$signature
,
'Unable to generate signature!'
);
$this
->
assertNotEmpty
(
$signature
,
'Unable to generate signature!'
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/authclient/signature/RsaSha1Test.php
View file @
32d07689
...
@@ -107,4 +107,4 @@ IyvuagHJR379p4dePwJBAMCkYSATGdhYbeDfySWUro5K0QAvBNj8FuNJQ4rqUxz8
...
@@ -107,4 +107,4 @@ IyvuagHJR379p4dePwJBAMCkYSATGdhYbeDfySWUro5K0QAvBNj8FuNJQ4rqUxz8
$signatureMethod
->
publicCertificateFile
=
$certificateFileName
;
$signatureMethod
->
publicCertificateFile
=
$certificateFileName
;
$this
->
assertEquals
(
file_get_contents
(
$certificateFileName
),
$signatureMethod
->
getPublicCertificate
(),
'Unable to fetch public certificate from file!'
);
$this
->
assertEquals
(
file_get_contents
(
$certificateFileName
),
$signatureMethod
->
getPublicCertificate
(),
'Unable to fetch public certificate from file!'
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/elasticsearch/ActiveRecordTest.php
View file @
32d07689
...
@@ -20,15 +20,45 @@ class ActiveRecordTest extends ElasticSearchTestCase
...
@@ -20,15 +20,45 @@ class ActiveRecordTest extends ElasticSearchTestCase
{
{
use
ActiveRecordTestTrait
;
use
ActiveRecordTestTrait
;
public
function
callCustomerFind
(
$q
=
null
)
{
return
Customer
::
find
(
$q
);
}
public
function
callCustomerFind
(
$q
=
null
)
public
function
callOrderFind
(
$q
=
null
)
{
return
Order
::
find
(
$q
);
}
{
public
function
callOrderItemFind
(
$q
=
null
)
{
return
OrderItem
::
find
(
$q
);
}
return
Customer
::
find
(
$q
);
public
function
callItemFind
(
$q
=
null
)
{
return
Item
::
find
(
$q
);
}
}
public
function
callOrderFind
(
$q
=
null
)
{
return
Order
::
find
(
$q
);
}
public
function
callOrderItemFind
(
$q
=
null
)
{
return
OrderItem
::
find
(
$q
);
}
public
function
getCustomerClass
()
{
return
Customer
::
className
();
}
public
function
callItemFind
(
$q
=
null
)
public
function
getItemClass
()
{
return
Item
::
className
();
}
{
public
function
getOrderClass
()
{
return
Order
::
className
();
}
return
Item
::
find
(
$q
);
public
function
getOrderItemClass
()
{
return
OrderItem
::
className
();
}
}
public
function
getCustomerClass
()
{
return
Customer
::
className
();
}
public
function
getItemClass
()
{
return
Item
::
className
();
}
public
function
getOrderClass
()
{
return
Order
::
className
();
}
public
function
getOrderItemClass
()
{
return
OrderItem
::
className
();
}
/**
/**
* can be overridden to do things after save()
* can be overridden to do things after save()
...
@@ -224,7 +254,7 @@ class ActiveRecordTest extends ElasticSearchTestCase
...
@@ -224,7 +254,7 @@ class ActiveRecordTest extends ElasticSearchTestCase
$records
=
Customer
::
mget
([
5
]);
$records
=
Customer
::
mget
([
5
]);
$this
->
assertEquals
(
0
,
count
(
$records
));
$this
->
assertEquals
(
0
,
count
(
$records
));
$records
=
Customer
::
mget
([
1
,
3
,
5
]);
$records
=
Customer
::
mget
([
1
,
3
,
5
]);
$this
->
assertEquals
(
2
,
count
(
$records
));
$this
->
assertEquals
(
2
,
count
(
$records
));
$this
->
assertInstanceOf
(
Customer
::
className
(),
$records
[
0
]);
$this
->
assertInstanceOf
(
Customer
::
className
(),
$records
[
0
]);
$this
->
assertInstanceOf
(
Customer
::
className
(),
$records
[
1
]);
$this
->
assertInstanceOf
(
Customer
::
className
(),
$records
[
1
]);
...
@@ -501,7 +531,7 @@ class ActiveRecordTest extends ElasticSearchTestCase
...
@@ -501,7 +531,7 @@ class ActiveRecordTest extends ElasticSearchTestCase
$customerClass
=
$this
->
getCustomerClass
();
$customerClass
=
$this
->
getCustomerClass
();
$afterFindCalls
=
[];
$afterFindCalls
=
[];
Event
::
on
(
BaseActiveRecord
::
className
(),
BaseActiveRecord
::
EVENT_AFTER_FIND
,
function
(
$event
)
use
(
&
$afterFindCalls
)
{
Event
::
on
(
BaseActiveRecord
::
className
(),
BaseActiveRecord
::
EVENT_AFTER_FIND
,
function
(
$event
)
use
(
&
$afterFindCalls
)
{
/** @var BaseActiveRecord $ar */
/** @var BaseActiveRecord $ar */
$ar
=
$event
->
sender
;
$ar
=
$event
->
sender
;
$afterFindCalls
[]
=
[
get_class
(
$ar
),
$ar
->
getIsNewRecord
(),
$ar
->
getPrimaryKey
(),
$ar
->
isRelationPopulated
(
'orders'
)];
$afterFindCalls
[]
=
[
get_class
(
$ar
),
$ar
->
getIsNewRecord
(),
$ar
->
getPrimaryKey
(),
$ar
->
isRelationPopulated
(
'orders'
)];
...
@@ -523,6 +553,5 @@ class ActiveRecordTest extends ElasticSearchTestCase
...
@@ -523,6 +553,5 @@ class ActiveRecordTest extends ElasticSearchTestCase
Event
::
off
(
BaseActiveRecord
::
className
(),
BaseActiveRecord
::
EVENT_AFTER_FIND
);
Event
::
off
(
BaseActiveRecord
::
className
(),
BaseActiveRecord
::
EVENT_AFTER_FIND
);
}
}
// TODO test AR with not mapped PK
// TODO test AR with not mapped PK
}
}
This diff is collapsed.
Click to expand it.
tests/unit/extensions/elasticsearch/ElasticSearchConnectionTest.php
View file @
32d07689
...
@@ -24,5 +24,4 @@ class ElasticSearchConnectionTest extends ElasticSearchTestCase
...
@@ -24,5 +24,4 @@ class ElasticSearchConnectionTest extends ElasticSearchTestCase
$this
->
assertArrayHasKey
(
'version'
,
reset
(
$connection
->
nodes
));
$this
->
assertArrayHasKey
(
'version'
,
reset
(
$connection
->
nodes
));
$this
->
assertArrayHasKey
(
'http_address'
,
reset
(
$connection
->
nodes
));
$this
->
assertArrayHasKey
(
'http_address'
,
reset
(
$connection
->
nodes
));
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/elasticsearch/QueryBuilderTest.php
View file @
32d07689
...
@@ -74,4 +74,3 @@ class QueryBuilderTest extends ElasticSearchTestCase
...
@@ -74,4 +74,3 @@ class QueryBuilderTest extends ElasticSearchTestCase
$this
->
assertEquals
(
3
,
$result
[
'hits'
][
'total'
]);
$this
->
assertEquals
(
3
,
$result
[
'hits'
][
'total'
]);
}
}
}
}
This diff is collapsed.
Click to expand it.
tests/unit/extensions/imagine/ImageGdTest.php
View file @
32d07689
...
@@ -26,5 +26,4 @@ class ImageGdTest extends AbstractImageTest
...
@@ -26,5 +26,4 @@ class ImageGdTest extends AbstractImageTest
$infos
=
gd_info
();
$infos
=
gd_info
();
return
isset
(
$infos
[
'FreeType Support'
])
?
$infos
[
'FreeType Support'
]
:
false
;
return
isset
(
$infos
[
'FreeType Support'
])
?
$infos
[
'FreeType Support'
]
:
false
;
}
}
}
}
This diff is collapsed.
Click to expand it.
tests/unit/extensions/imagine/ImageGmagickTest.php
View file @
32d07689
...
@@ -26,5 +26,4 @@ class ImageGmagickTest extends AbstractImageTest
...
@@ -26,5 +26,4 @@ class ImageGmagickTest extends AbstractImageTest
{
{
return
true
;
return
true
;
}
}
}
}
This diff is collapsed.
Click to expand it.
tests/unit/extensions/imagine/ImageImagickTest.php
View file @
32d07689
...
@@ -26,5 +26,4 @@ class ImageImagickTest extends AbstractImageTest
...
@@ -26,5 +26,4 @@ class ImageImagickTest extends AbstractImageTest
{
{
return
true
;
return
true
;
}
}
}
}
This diff is collapsed.
Click to expand it.
tests/unit/extensions/mongodb/ActiveDataProviderTest.php
View file @
32d07689
...
@@ -88,4 +88,4 @@ class ActiveDataProviderTest extends MongoDbTestCase
...
@@ -88,4 +88,4 @@ class ActiveDataProviderTest extends MongoDbTestCase
$models
=
$provider
->
getModels
();
$models
=
$provider
->
getModels
();
$this
->
assertEquals
(
5
,
count
(
$models
));
$this
->
assertEquals
(
5
,
count
(
$models
));
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/mongodb/ActiveRecordTest.php
View file @
32d07689
...
@@ -263,4 +263,4 @@ class ActiveRecordTest extends MongoDbTestCase
...
@@ -263,4 +263,4 @@ class ActiveRecordTest extends MongoDbTestCase
$this
->
assertNotEmpty
(
$rowRefreshed
);
$this
->
assertNotEmpty
(
$rowRefreshed
);
$this
->
assertEquals
(
7
,
$rowRefreshed
->
status
);
$this
->
assertEquals
(
7
,
$rowRefreshed
->
status
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/mongodb/CacheTest.php
View file @
32d07689
...
@@ -132,4 +132,4 @@ class CacheTest extends MongoDbTestCase
...
@@ -132,4 +132,4 @@ class CacheTest extends MongoDbTestCase
$this
->
assertEquals
(
false
,
$cache
->
get
(
$key
),
'Expired key value returned!'
);
$this
->
assertEquals
(
false
,
$cache
->
get
(
$key
),
'Expired key value returned!'
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/mongodb/CollectionTest.php
View file @
32d07689
...
@@ -419,4 +419,4 @@ class CollectionTest extends MongoDbTestCase
...
@@ -419,4 +419,4 @@ class CollectionTest extends MongoDbTestCase
$this
->
assertNotEmpty
(
$result
);
$this
->
assertNotEmpty
(
$result
);
$this
->
assertCount
(
2
,
$result
);
$this
->
assertCount
(
2
,
$result
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/mongodb/ConnectionTest.php
View file @
32d07689
...
@@ -116,4 +116,4 @@ class ConnectionTest extends MongoDbTestCase
...
@@ -116,4 +116,4 @@ class ConnectionTest extends MongoDbTestCase
$collection2
=
$connection
->
getFileCollection
(
'testfs'
,
true
);
$collection2
=
$connection
->
getFileCollection
(
'testfs'
,
true
);
$this
->
assertFalse
(
$collection
===
$collection2
);
$this
->
assertFalse
(
$collection
===
$collection2
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/mongodb/DatabaseTest.php
View file @
32d07689
...
@@ -67,4 +67,4 @@ class DatabaseTest extends MongoDbTestCase
...
@@ -67,4 +67,4 @@ class DatabaseTest extends MongoDbTestCase
$collection
=
$database
->
createCollection
(
'customer'
);
$collection
=
$database
->
createCollection
(
'customer'
);
$this
->
assertTrue
(
$collection
instanceof
\MongoCollection
);
$this
->
assertTrue
(
$collection
instanceof
\MongoCollection
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/mongodb/QueryRunTest.php
View file @
32d07689
...
@@ -141,4 +141,4 @@ class QueryRunTest extends MongoDbTestCase
...
@@ -141,4 +141,4 @@ class QueryRunTest extends MongoDbTestCase
$this
->
assertEquals
(
'name1'
,
$rows
[
0
][
'name'
]);
$this
->
assertEquals
(
'name1'
,
$rows
[
0
][
'name'
]);
$this
->
assertEquals
(
'name10'
,
$rows
[
1
][
'name'
]);
$this
->
assertEquals
(
'name10'
,
$rows
[
1
][
'name'
]);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/mongodb/QueryTest.php
View file @
32d07689
...
@@ -94,4 +94,4 @@ class QueryTest extends MongoDbTestCase
...
@@ -94,4 +94,4 @@ class QueryTest extends MongoDbTestCase
$this
->
assertEquals
(
10
,
$query
->
limit
);
$this
->
assertEquals
(
10
,
$query
->
limit
);
$this
->
assertEquals
(
5
,
$query
->
offset
);
$this
->
assertEquals
(
5
,
$query
->
offset
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/mongodb/SessionTest.php
View file @
32d07689
...
@@ -137,4 +137,4 @@ class SessionTest extends MongoDbTestCase
...
@@ -137,4 +137,4 @@ class SessionTest extends MongoDbTestCase
$rows
=
$this
->
findAll
(
$collection
);
$rows
=
$this
->
findAll
(
$collection
);
$this
->
assertCount
(
1
,
$rows
,
'Wrong records count!'
);
$this
->
assertCount
(
1
,
$rows
,
'Wrong records count!'
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/mongodb/file/ActiveRecordTest.php
View file @
32d07689
...
@@ -320,4 +320,4 @@ class ActiveRecordTest extends MongoDbTestCase
...
@@ -320,4 +320,4 @@ class ActiveRecordTest extends MongoDbTestCase
fclose
(
$fileResource
);
fclose
(
$fileResource
);
$this
->
assertEquals
(
$newFileContent
,
$contents
);
$this
->
assertEquals
(
$newFileContent
,
$contents
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/mongodb/file/CollectionTest.php
View file @
32d07689
...
@@ -95,4 +95,4 @@ class CollectionTest extends MongoDbTestCase
...
@@ -95,4 +95,4 @@ class CollectionTest extends MongoDbTestCase
$file
=
$collection
->
get
(
$id
);
$file
=
$collection
->
get
(
$id
);
$this
->
assertNull
(
$file
);
$this
->
assertNull
(
$file
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/mongodb/file/QueryTest.php
View file @
32d07689
...
@@ -67,4 +67,4 @@ class QueryTest extends MongoDbTestCase
...
@@ -67,4 +67,4 @@ class QueryTest extends MongoDbTestCase
$file
=
$rows
[
0
];
$file
=
$rows
[
0
];
$this
->
assertEquals
(
'name5'
,
$file
[
'filename'
]);
$this
->
assertEquals
(
'name5'
,
$file
[
'filename'
]);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/redis/ActiveRecordTest.php
View file @
32d07689
...
@@ -16,15 +16,45 @@ class ActiveRecordTest extends RedisTestCase
...
@@ -16,15 +16,45 @@ class ActiveRecordTest extends RedisTestCase
{
{
use
ActiveRecordTestTrait
;
use
ActiveRecordTestTrait
;
public
function
callCustomerFind
(
$q
=
null
)
{
return
Customer
::
find
(
$q
);
}
public
function
callCustomerFind
(
$q
=
null
)
public
function
callOrderFind
(
$q
=
null
)
{
return
Order
::
find
(
$q
);
}
{
public
function
callOrderItemFind
(
$q
=
null
)
{
return
OrderItem
::
find
(
$q
);
}
return
Customer
::
find
(
$q
);
public
function
callItemFind
(
$q
=
null
)
{
return
Item
::
find
(
$q
);
}
}
public
function
callOrderFind
(
$q
=
null
)
{
return
Order
::
find
(
$q
);
}
public
function
callOrderItemFind
(
$q
=
null
)
{
return
OrderItem
::
find
(
$q
);
}
public
function
callItemFind
(
$q
=
null
)
{
return
Item
::
find
(
$q
);
}
public
function
getCustomerClass
()
{
return
Customer
::
className
();
}
public
function
getCustomerClass
()
public
function
getItemClass
()
{
return
Item
::
className
();
}
{
public
function
getOrderClass
()
{
return
Order
::
className
();
}
return
Customer
::
className
();
public
function
getOrderItemClass
()
{
return
OrderItem
::
className
();
}
}
public
function
getItemClass
()
{
return
Item
::
className
();
}
public
function
getOrderClass
()
{
return
Order
::
className
();
}
public
function
getOrderItemClass
()
{
return
OrderItem
::
className
();
}
public
function
setUp
()
public
function
setUp
()
...
@@ -207,7 +237,7 @@ class ActiveRecordTest extends RedisTestCase
...
@@ -207,7 +237,7 @@ class ActiveRecordTest extends RedisTestCase
public
function
testFindColumn
()
public
function
testFindColumn
()
{
{
$this
->
assertEquals
([
'user1'
,
'user2'
,
'user3'
],
Customer
::
find
()
->
column
(
'name'
));
$this
->
assertEquals
([
'user1'
,
'user2'
,
'user3'
],
Customer
::
find
()
->
column
(
'name'
));
//
TODO $this->assertEquals(['user3', 'user2', 'user1'], Customer::find()->orderBy(['name' => SORT_DESC])->column('name'));
//
TODO $this->assertEquals(['user3', 'user2', 'user1'], Customer::find()->orderBy(['name' => SORT_DESC])->column('name'));
}
}
// TODO test serial column incr
// TODO test serial column incr
...
...
This diff is collapsed.
Click to expand it.
tests/unit/extensions/redis/RedisCacheTest.php
View file @
32d07689
...
@@ -97,5 +97,4 @@ class RedisCacheTest extends CacheTestCase
...
@@ -97,5 +97,4 @@ class RedisCacheTest extends CacheTestCase
$cache
->
set
(
$key
,
$data
);
$cache
->
set
(
$key
,
$data
);
$this
->
assertTrue
(
$cache
->
get
(
$key
)
===
$data
);
$this
->
assertTrue
(
$cache
->
get
(
$key
)
===
$data
);
}
}
}
}
This diff is collapsed.
Click to expand it.
tests/unit/extensions/smarty/ViewRendererTest.php
View file @
32d07689
...
@@ -67,4 +67,4 @@ class ViewRendererTest extends TestCase
...
@@ -67,4 +67,4 @@ class ViewRendererTest extends TestCase
'baseUrl'
=>
'/assets'
,
'baseUrl'
=>
'/assets'
,
]);
]);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/sphinx/ActiveDataProviderTest.php
View file @
32d07689
...
@@ -63,4 +63,4 @@ class ActiveDataProviderTest extends SphinxTestCase
...
@@ -63,4 +63,4 @@ class ActiveDataProviderTest extends SphinxTestCase
$models
=
$provider
->
getModels
();
$models
=
$provider
->
getModels
();
$this
->
assertEquals
(
1
,
count
(
$models
));
$this
->
assertEquals
(
1
,
count
(
$models
));
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/sphinx/ActiveRecordTest.php
View file @
32d07689
...
@@ -234,4 +234,4 @@ class ActiveRecordTest extends SphinxTestCase
...
@@ -234,4 +234,4 @@ class ActiveRecordTest extends SphinxTestCase
$this
->
assertArrayHasKey
(
'tokenized'
,
$rows
[
0
],
'No tokenized keyword!'
);
$this
->
assertArrayHasKey
(
'tokenized'
,
$rows
[
0
],
'No tokenized keyword!'
);
$this
->
assertArrayHasKey
(
'normalized'
,
$rows
[
0
],
'No normalized keyword!'
);
$this
->
assertArrayHasKey
(
'normalized'
,
$rows
[
0
],
'No normalized keyword!'
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/sphinx/ColumnSchemaTest.php
View file @
32d07689
...
@@ -52,4 +52,4 @@ class ColumnSchemaTest extends SphinxTestCase
...
@@ -52,4 +52,4 @@ class ColumnSchemaTest extends SphinxTestCase
$columnSchema
->
phpType
=
$phpType
;
$columnSchema
->
phpType
=
$phpType
;
$this
->
assertEquals
(
$expectedResult
,
$columnSchema
->
typecast
(
$value
));
$this
->
assertEquals
(
$expectedResult
,
$columnSchema
->
typecast
(
$value
));
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/sphinx/CommandTest.php
View file @
32d07689
...
@@ -222,7 +222,7 @@ class CommandTest extends SphinxTestCase
...
@@ -222,7 +222,7 @@ class CommandTest extends SphinxTestCase
$this
->
assertEquals
(
1
,
count
(
$rows
),
'No row inserted!'
);
$this
->
assertEquals
(
1
,
count
(
$rows
),
'No row inserted!'
);
$newTypeId
=
5
;
$newTypeId
=
5
;
$command
=
$db
->
createCommand
()
->
replace
(
'yii2_test_rt_index'
,[
$command
=
$db
->
createCommand
()
->
replace
(
'yii2_test_rt_index'
,
[
'type_id'
=>
$newTypeId
,
'type_id'
=>
$newTypeId
,
'category'
=>
[
3
,
4
],
'category'
=>
[
3
,
4
],
'id'
=>
1
,
'id'
=>
1
,
...
@@ -272,7 +272,7 @@ class CommandTest extends SphinxTestCase
...
@@ -272,7 +272,7 @@ class CommandTest extends SphinxTestCase
$this
->
assertEquals
(
2
,
count
(
$rows
),
'No rows inserted!'
);
$this
->
assertEquals
(
2
,
count
(
$rows
),
'No rows inserted!'
);
$newTypeId
=
5
;
$newTypeId
=
5
;
$command
=
$db
->
createCommand
()
->
replace
(
'yii2_test_rt_index'
,[
$command
=
$db
->
createCommand
()
->
replace
(
'yii2_test_rt_index'
,
[
'type_id'
=>
$newTypeId
,
'type_id'
=>
$newTypeId
,
'id'
=>
1
,
'id'
=>
1
,
]);
]);
...
@@ -406,4 +406,4 @@ class CommandTest extends SphinxTestCase
...
@@ -406,4 +406,4 @@ class CommandTest extends SphinxTestCase
$this
->
assertArrayHasKey
(
'docs'
,
$rows
[
0
],
'No docs!'
);
$this
->
assertArrayHasKey
(
'docs'
,
$rows
[
0
],
'No docs!'
);
$this
->
assertArrayHasKey
(
'hits'
,
$rows
[
0
],
'No hits!'
);
$this
->
assertArrayHasKey
(
'hits'
,
$rows
[
0
],
'No hits!'
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/sphinx/ConnectionTest.php
View file @
32d07689
...
@@ -39,4 +39,4 @@ class ConnectionTest extends SphinxTestCase
...
@@ -39,4 +39,4 @@ class ConnectionTest extends SphinxTestCase
$this
->
setExpectedException
(
'yii\db\Exception'
);
$this
->
setExpectedException
(
'yii\db\Exception'
);
$connection
->
open
();
$connection
->
open
();
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/sphinx/QueryTest.php
View file @
32d07689
...
@@ -161,7 +161,7 @@ class QueryTest extends SphinxTestCase
...
@@ -161,7 +161,7 @@ class QueryTest extends SphinxTestCase
$match
=
'about'
;
$match
=
'about'
;
$snippetPrefix
=
'snippet#'
;
$snippetPrefix
=
'snippet#'
;
$snippetCallback
=
function
()
use
(
$match
,
$snippetPrefix
)
{
$snippetCallback
=
function
()
use
(
$match
,
$snippetPrefix
)
{
return
[
return
[
$snippetPrefix
.
'1: '
.
$match
,
$snippetPrefix
.
'1: '
.
$match
,
$snippetPrefix
.
'2: '
.
$match
,
$snippetPrefix
.
'2: '
.
$match
,
...
@@ -195,4 +195,4 @@ class QueryTest extends SphinxTestCase
...
@@ -195,4 +195,4 @@ class QueryTest extends SphinxTestCase
->
count
(
'*'
,
$connection
);
->
count
(
'*'
,
$connection
);
$this
->
assertEquals
(
2
,
$count
);
$this
->
assertEquals
(
2
,
$count
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/sphinx/SchemaTest.php
View file @
32d07689
...
@@ -80,4 +80,4 @@ class SchemaTest extends SphinxTestCase
...
@@ -80,4 +80,4 @@ class SchemaTest extends SphinxTestCase
$this
->
assertEquals
(
'rt'
,
$index
->
type
);
$this
->
assertEquals
(
'rt'
,
$index
->
type
);
$this
->
assertTrue
(
$index
->
isRuntime
);
$this
->
assertTrue
(
$index
->
isRuntime
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/extensions/twig/ViewRendererTest.php
View file @
32d07689
...
@@ -71,4 +71,4 @@ class ViewRendererTest extends TestCase
...
@@ -71,4 +71,4 @@ class ViewRendererTest extends TestCase
'baseUrl'
=>
'/assets'
,
'baseUrl'
=>
'/assets'
,
]);
]);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/framework/ar/ActiveRecordTestTrait.php
View file @
32d07689
...
@@ -356,11 +356,11 @@ trait ActiveRecordTestTrait
...
@@ -356,11 +356,11 @@ trait ActiveRecordTestTrait
$this
->
assertEquals
(
2
,
$this
->
callCustomerFind
()
->
where
([
'OR'
,
[
'name'
=>
'user1'
],
[
'name'
=>
'user2'
]])
->
count
());
$this
->
assertEquals
(
2
,
$this
->
callCustomerFind
()
->
where
([
'OR'
,
[
'name'
=>
'user1'
],
[
'name'
=>
'user2'
]])
->
count
());
$this
->
assertEquals
(
2
,
count
(
$this
->
callCustomerFind
()
->
where
([
'OR'
,
[
'name'
=>
'user1'
],
[
'name'
=>
'user2'
]])
->
all
()));
$this
->
assertEquals
(
2
,
count
(
$this
->
callCustomerFind
()
->
where
([
'OR'
,
[
'name'
=>
'user1'
],
[
'name'
=>
'user2'
]])
->
all
()));
$this
->
assertEquals
(
2
,
$this
->
callCustomerFind
()
->
where
([
'name'
=>
[
'user1'
,
'user2'
]])
->
count
());
$this
->
assertEquals
(
2
,
$this
->
callCustomerFind
()
->
where
([
'name'
=>
[
'user1'
,
'user2'
]])
->
count
());
$this
->
assertEquals
(
2
,
count
(
$this
->
callCustomerFind
()
->
where
([
'name'
=>
[
'user1'
,
'user2'
]])
->
all
()));
$this
->
assertEquals
(
2
,
count
(
$this
->
callCustomerFind
()
->
where
([
'name'
=>
[
'user1'
,
'user2'
]])
->
all
()));
$this
->
assertEquals
(
1
,
$this
->
callCustomerFind
()
->
where
([
'AND'
,
[
'name'
=>
[
'user2'
,
'user3'
]],
[
'BETWEEN'
,
'status'
,
2
,
4
]])
->
count
());
$this
->
assertEquals
(
1
,
$this
->
callCustomerFind
()
->
where
([
'AND'
,
[
'name'
=>
[
'user2'
,
'user3'
]],
[
'BETWEEN'
,
'status'
,
2
,
4
]])
->
count
());
$this
->
assertEquals
(
1
,
count
(
$this
->
callCustomerFind
()
->
where
([
'AND'
,
[
'name'
=>
[
'user2'
,
'user3'
]],
[
'BETWEEN'
,
'status'
,
2
,
4
]])
->
all
()));
$this
->
assertEquals
(
1
,
count
(
$this
->
callCustomerFind
()
->
where
([
'AND'
,
[
'name'
=>
[
'user2'
,
'user3'
]],
[
'BETWEEN'
,
'status'
,
2
,
4
]])
->
all
()));
}
}
public
function
testFindNullValues
()
public
function
testFindNullValues
()
...
@@ -384,9 +384,9 @@ trait ActiveRecordTestTrait
...
@@ -384,9 +384,9 @@ trait ActiveRecordTestTrait
$this
->
assertTrue
(
$this
->
callCustomerFind
()
->
where
([
'name'
=>
'user1'
])
->
exists
());
$this
->
assertTrue
(
$this
->
callCustomerFind
()
->
where
([
'name'
=>
'user1'
])
->
exists
());
$this
->
assertFalse
(
$this
->
callCustomerFind
()
->
where
([
'name'
=>
'user5'
])
->
exists
());
$this
->
assertFalse
(
$this
->
callCustomerFind
()
->
where
([
'name'
=>
'user5'
])
->
exists
());
$this
->
assertTrue
(
$this
->
callCustomerFind
()
->
where
([
'id'
=>
[
2
,
3
]])
->
exists
());
$this
->
assertTrue
(
$this
->
callCustomerFind
()
->
where
([
'id'
=>
[
2
,
3
]])
->
exists
());
$this
->
assertTrue
(
$this
->
callCustomerFind
()
->
where
([
'id'
=>
[
2
,
3
]])
->
offset
(
1
)
->
exists
());
$this
->
assertTrue
(
$this
->
callCustomerFind
()
->
where
([
'id'
=>
[
2
,
3
]])
->
offset
(
1
)
->
exists
());
$this
->
assertFalse
(
$this
->
callCustomerFind
()
->
where
([
'id'
=>
[
2
,
3
]])
->
offset
(
2
)
->
exists
());
$this
->
assertFalse
(
$this
->
callCustomerFind
()
->
where
([
'id'
=>
[
2
,
3
]])
->
offset
(
2
)
->
exists
());
}
}
public
function
testFindLazy
()
public
function
testFindLazy
()
...
@@ -854,7 +854,7 @@ trait ActiveRecordTestTrait
...
@@ -854,7 +854,7 @@ trait ActiveRecordTestTrait
/** @var TestCase|ActiveRecordTestTrait $this */
/** @var TestCase|ActiveRecordTestTrait $this */
$afterFindCalls
=
[];
$afterFindCalls
=
[];
Event
::
on
(
BaseActiveRecord
::
className
(),
BaseActiveRecord
::
EVENT_AFTER_FIND
,
function
(
$event
)
use
(
&
$afterFindCalls
)
{
Event
::
on
(
BaseActiveRecord
::
className
(),
BaseActiveRecord
::
EVENT_AFTER_FIND
,
function
(
$event
)
use
(
&
$afterFindCalls
)
{
/** @var BaseActiveRecord $ar */
/** @var BaseActiveRecord $ar */
$ar
=
$event
->
sender
;
$ar
=
$event
->
sender
;
$afterFindCalls
[]
=
[
get_class
(
$ar
),
$ar
->
getIsNewRecord
(),
$ar
->
getPrimaryKey
(),
$ar
->
isRelationPopulated
(
'orders'
)];
$afterFindCalls
[]
=
[
get_class
(
$ar
),
$ar
->
getIsNewRecord
(),
$ar
->
getPrimaryKey
(),
$ar
->
isRelationPopulated
(
'orders'
)];
...
...
This diff is collapsed.
Click to expand it.
tests/unit/framework/base/BehaviorTest.php
View file @
32d07689
...
@@ -102,5 +102,4 @@ class BehaviorTest extends TestCase
...
@@ -102,5 +102,4 @@ class BehaviorTest extends TestCase
$bar
->
attachBehavior
(
'bar'
,
$behavior
);
$bar
->
attachBehavior
(
'bar'
,
$behavior
);
$bar
->
nomagicBehaviorMethod
();
$bar
->
nomagicBehaviorMethod
();
}
}
}
}
This diff is collapsed.
Click to expand it.
tests/unit/framework/base/EventTest.php
View file @
32d07689
...
@@ -89,5 +89,4 @@ class Post extends ActiveRecord
...
@@ -89,5 +89,4 @@ class Post extends ActiveRecord
class
User
extends
ActiveRecord
class
User
extends
ActiveRecord
{
{
}
}
This diff is collapsed.
Click to expand it.
tests/unit/framework/db/ActiveRecordTest.php
View file @
32d07689
...
@@ -24,15 +24,45 @@ class ActiveRecordTest extends DatabaseTestCase
...
@@ -24,15 +24,45 @@ class ActiveRecordTest extends DatabaseTestCase
ActiveRecord
::
$db
=
$this
->
getConnection
();
ActiveRecord
::
$db
=
$this
->
getConnection
();
}
}
public
function
callCustomerFind
(
$q
=
null
)
{
return
Customer
::
find
(
$q
);
}
public
function
callCustomerFind
(
$q
=
null
)
public
function
callOrderFind
(
$q
=
null
)
{
return
Order
::
find
(
$q
);
}
{
public
function
callOrderItemFind
(
$q
=
null
)
{
return
OrderItem
::
find
(
$q
);
}
return
Customer
::
find
(
$q
);
public
function
callItemFind
(
$q
=
null
)
{
return
Item
::
find
(
$q
);
}
}
public
function
callOrderFind
(
$q
=
null
)
{
return
Order
::
find
(
$q
);
}
public
function
callOrderItemFind
(
$q
=
null
)
{
return
OrderItem
::
find
(
$q
);
}
public
function
getCustomerClass
()
{
return
Customer
::
className
();
}
public
function
callItemFind
(
$q
=
null
)
public
function
getItemClass
()
{
return
Item
::
className
();
}
{
public
function
getOrderClass
()
{
return
Order
::
className
();
}
return
Item
::
find
(
$q
);
public
function
getOrderItemClass
()
{
return
OrderItem
::
className
();
}
}
public
function
getCustomerClass
()
{
return
Customer
::
className
();
}
public
function
getItemClass
()
{
return
Item
::
className
();
}
public
function
getOrderClass
()
{
return
Order
::
className
();
}
public
function
getOrderItemClass
()
{
return
OrderItem
::
className
();
}
public
function
testCustomColumns
()
public
function
testCustomColumns
()
{
{
...
@@ -284,7 +314,7 @@ class ActiveRecordTest extends DatabaseTestCase
...
@@ -284,7 +314,7 @@ class ActiveRecordTest extends DatabaseTestCase
$orders
=
Order
::
find
()
->
innerJoinWith
([
$orders
=
Order
::
find
()
->
innerJoinWith
([
'customer'
=>
function
(
$query
)
{
'customer'
=>
function
(
$query
)
{
$query
->
where
([
'tbl_customer.id'
=>
2
]);
$query
->
where
([
'tbl_customer.id'
=>
2
]);
},
},
],
false
)
->
where
([
'tbl_order.id'
=>
[
1
,
2
]])
->
orderBy
(
'tbl_order.id'
)
->
all
();
],
false
)
->
where
([
'tbl_order.id'
=>
[
1
,
2
]])
->
orderBy
(
'tbl_order.id'
)
->
all
();
$this
->
assertEquals
(
1
,
count
(
$orders
));
$this
->
assertEquals
(
1
,
count
(
$orders
));
$this
->
assertEquals
(
2
,
$orders
[
0
]
->
id
);
$this
->
assertEquals
(
2
,
$orders
[
0
]
->
id
);
...
...
This diff is collapsed.
Click to expand it.
tests/unit/framework/db/QueryBuilderTest.php
View file @
32d07689
...
@@ -239,5 +239,4 @@ class QueryBuilderTest extends DatabaseTestCase
...
@@ -239,5 +239,4 @@ class QueryBuilderTest extends DatabaseTestCase
list($actualQuerySql, $queryParams) = $this->getQueryBuilder()->build($query);
list($actualQuerySql, $queryParams) = $this->getQueryBuilder()->build($query);
$this->assertEquals($expectedQuerySql, $actualQuerySql);
$this->assertEquals($expectedQuerySql, $actualQuerySql);
}*/
}*/
}
}
This diff is collapsed.
Click to expand it.
tests/unit/framework/db/cubrid/CubridQueryBuilderTest.php
View file @
32d07689
...
@@ -79,5 +79,4 @@ class CubridQueryBuilderTest extends QueryBuilderTest
...
@@ -79,5 +79,4 @@ class CubridQueryBuilderTest extends QueryBuilderTest
[
Schema
::
TYPE_MONEY
.
' NOT NULL'
,
'decimal(19,4) NOT NULL'
],
[
Schema
::
TYPE_MONEY
.
' NOT NULL'
,
'decimal(19,4) NOT NULL'
],
];
];
}
}
}
}
This diff is collapsed.
Click to expand it.
tests/unit/framework/db/mssql/MssqlQueryBuilderTest.php
View file @
32d07689
...
@@ -12,49 +12,46 @@ use yii\db\Query;
...
@@ -12,49 +12,46 @@ use yii\db\Query;
class
MSSQLQueryBuilderTest
extends
QueryBuilderTest
class
MSSQLQueryBuilderTest
extends
QueryBuilderTest
{
{
public
$driverName
=
'sqlsrv'
;
public
$driverName
=
'sqlsrv'
;
public
function
testOffsetLimit
()
{
public
function
testOffsetLimit
()
$expectedQuerySql
=
'SELECT `id` FROM `exapmle` OFFSET 5 ROWS FETCH NEXT 10 ROWS ONLY'
;
{
$expectedQueryParams
=
null
;
$expectedQuerySql
=
'SELECT `id` FROM `exapmle` OFFSET 5 ROWS FETCH NEXT 10 ROWS ONLY'
;
$expectedQueryParams
=
null
;
$query
=
new
Query
();
$query
->
select
(
'id'
)
$query
=
new
Query
();
->
from
(
'example'
)
$query
->
select
(
'id'
)
->
from
(
'example'
)
->
limit
(
10
)
->
offset
(
5
);
->
limit
(
10
)
->
offset
(
5
);
list
(
$actualQuerySql
,
$actualQueryParams
)
=
$this
->
getQueryBuilder
()
->
build
(
$query
);
list
(
$actualQuerySql
,
$actualQueryParams
)
=
$this
->
getQueryBuilder
()
->
build
(
$query
);
$this
->
assertEquals
(
$expectedQuerySql
,
$actualQuerySql
);
$this
->
assertEquals
(
$expectedQuerySql
,
$actualQuerySql
);
$this
->
assertEquals
(
$expectedQueryParams
,
$actualQueryParams
);
$this
->
assertEquals
(
$expectedQueryParams
,
$actualQueryParams
);
}
}
public
function
testLimit
()
public
function
testLimit
()
{
{
$expectedQuerySql
=
'SELECT `id` FROM `exapmle` OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY'
;
$expectedQuerySql
=
'SELECT `id` FROM `exapmle` OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY'
;
$expectedQueryParams
=
null
;
$expectedQueryParams
=
null
;
$query
=
new
Query
();
$query
=
new
Query
();
$query
->
select
(
'id'
)
$query
->
select
(
'id'
)
->
from
(
'example'
)
->
limit
(
10
);
->
from
(
'example'
)
->
limit
(
10
);
list
(
$actualQuerySql
,
$actualQueryParams
)
=
$this
->
getQueryBuilder
()
->
build
(
$query
);
list
(
$actualQuerySql
,
$actualQueryParams
)
=
$this
->
getQueryBuilder
()
->
build
(
$query
);
$this
->
assertEquals
(
$expectedQuerySql
,
$actualQuerySql
);
$this
->
assertEquals
(
$expectedQueryParams
,
$actualQueryParams
);
$this
->
assertEquals
(
$expectedQuerySql
,
$actualQuerySql
);
}
$this
->
assertEquals
(
$expectedQueryParams
,
$actualQueryParams
);
}
public
function
testOffset
()
{
public
function
testOffset
()
{
$expectedQuerySql
=
'SELECT `id` FROM `exapmle` OFFSET 10 ROWS'
;
$expectedQuerySql
=
'SELECT `id` FROM `exapmle` OFFSET 10 ROWS'
;
$expectedQueryParams
=
null
;
$expectedQueryParams
=
null
;
$query
=
new
Query
();
$query
=
new
Query
();
$query
->
select
(
'id'
)
->
from
(
'example'
)
->
offset
(
10
);
$query
->
select
(
'id'
)
->
from
(
'example'
)
list
(
$actualQuerySql
,
$actualQueryParams
)
=
$this
->
getQueryBuilder
()
->
build
(
$query
);
->
offset
(
10
);
$this
->
assertEquals
(
$expectedQuerySql
,
$actualQuerySql
);
list
(
$actualQuerySql
,
$actualQueryParams
)
=
$this
->
getQueryBuilder
()
->
build
(
$query
);
$this
->
assertEquals
(
$expectedQueryParams
,
$actualQueryParams
);
}
$this
->
assertEquals
(
$expectedQuerySql
,
$actualQuerySql
);
}
$this
->
assertEquals
(
$expectedQueryParams
,
$actualQueryParams
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/framework/db/sqlite/SqliteQueryBuilderTest.php
View file @
32d07689
...
@@ -84,7 +84,7 @@ class SqliteQueryBuilderTest extends QueryBuilderTest
...
@@ -84,7 +84,7 @@ class SqliteQueryBuilderTest extends QueryBuilderTest
public
function
testBatchInsert
()
public
function
testBatchInsert
()
{
{
$sql
=
$this
->
getQueryBuilder
()
->
batchInsert
(
'{{tbl_customer}} t'
,
[
't.id'
,
't.name'
],
[[
1
,
'a'
],
[
2
,
'b'
]]);
$sql
=
$this
->
getQueryBuilder
()
->
batchInsert
(
'{{tbl_customer}} t'
,
[
't.id'
,
't.name'
],
[[
1
,
'a'
],
[
2
,
'b'
]]);
$this
->
assertEquals
(
"INSERT INTO
{
{tbl_customer}
}
t (`t`.`id`, `t`.`name`) SELECT 1, 'a' UNION ALL 2, 'b'"
,
$sql
);
$this
->
assertEquals
(
"INSERT INTO
{
{tbl_customer}
}
t (`t`.`id`, `t`.`name`) SELECT 1, 'a' UNION ALL 2, 'b'"
,
$sql
);
}
}
}
}
This diff is collapsed.
Click to expand it.
tests/unit/framework/helpers/FileHelperTest.php
View file @
32d07689
...
@@ -255,16 +255,20 @@ class FileHelperTest extends TestCase
...
@@ -255,16 +255,20 @@ class FileHelperTest extends TestCase
{
{
$basePath
=
$this
->
testFilePath
.
DIRECTORY_SEPARATOR
;
$basePath
=
$this
->
testFilePath
.
DIRECTORY_SEPARATOR
;
$dirs
=
[
''
,
'one'
,
'one'
.
DIRECTORY_SEPARATOR
.
'two'
,
'three'
];
$dirs
=
[
''
,
'one'
,
'one'
.
DIRECTORY_SEPARATOR
.
'two'
,
'three'
];
$files
=
array_fill_keys
(
array_map
(
function
(
$n
){
return
"a.
$n
"
;},
range
(
1
,
8
)),
'file contents'
);
$files
=
array_fill_keys
(
array_map
(
function
(
$n
)
{
return
"a.
$n
"
;
},
range
(
1
,
8
)),
'file contents'
);
$tree
=
$files
;
$tree
=
$files
;
$root
=
$files
;
$root
=
$files
;
$flat
=
[];
$flat
=
[];
foreach
(
$dirs
as
$dir
)
{
foreach
(
$dirs
as
$dir
)
{
foreach
(
$files
as
$fileName
=>
$contents
)
{
foreach
(
$files
as
$fileName
=>
$contents
)
{
$flat
[]
=
rtrim
(
$basePath
.
$dir
,
DIRECTORY_SEPARATOR
)
.
DIRECTORY_SEPARATOR
.
$fileName
;
$flat
[]
=
rtrim
(
$basePath
.
$dir
,
DIRECTORY_SEPARATOR
)
.
DIRECTORY_SEPARATOR
.
$fileName
;
}
if
(
$dir
===
''
)
{
continue
;
}
}
if
(
$dir
===
''
)
continue
;
$parts
=
explode
(
DIRECTORY_SEPARATOR
,
$dir
);
$parts
=
explode
(
DIRECTORY_SEPARATOR
,
$dir
);
$last
=
array_pop
(
$parts
);
$last
=
array_pop
(
$parts
);
$parent
=
array_pop
(
$parts
);
$parent
=
array_pop
(
$parts
);
...
@@ -280,25 +284,31 @@ class FileHelperTest extends TestCase
...
@@ -280,25 +284,31 @@ class FileHelperTest extends TestCase
// range
// range
$foundFiles
=
FileHelper
::
findFiles
(
$basePath
,
[
'except'
=>
[
'a.[2-8]'
]]);
$foundFiles
=
FileHelper
::
findFiles
(
$basePath
,
[
'except'
=>
[
'a.[2-8]'
]]);
sort
(
$foundFiles
);
sort
(
$foundFiles
);
$expect
=
array_values
(
array_filter
(
$flat
,
function
(
$p
){
return
substr
(
$p
,
-
3
)
===
'a.1'
;}));
$expect
=
array_values
(
array_filter
(
$flat
,
function
(
$p
)
{
return
substr
(
$p
,
-
3
)
===
'a.1'
;
}));
$this
->
assertEquals
(
$expect
,
$foundFiles
);
$this
->
assertEquals
(
$expect
,
$foundFiles
);
// suffix
// suffix
$foundFiles
=
FileHelper
::
findFiles
(
$basePath
,
[
'except'
=>
[
'*.1'
]]);
$foundFiles
=
FileHelper
::
findFiles
(
$basePath
,
[
'except'
=>
[
'*.1'
]]);
sort
(
$foundFiles
);
sort
(
$foundFiles
);
$expect
=
array_values
(
array_filter
(
$flat
,
function
(
$p
){
return
substr
(
$p
,
-
3
)
!==
'a.1'
;}));
$expect
=
array_values
(
array_filter
(
$flat
,
function
(
$p
)
{
return
substr
(
$p
,
-
3
)
!==
'a.1'
;
}));
$this
->
assertEquals
(
$expect
,
$foundFiles
);
$this
->
assertEquals
(
$expect
,
$foundFiles
);
// dir
// dir
$foundFiles
=
FileHelper
::
findFiles
(
$basePath
,
[
'except'
=>
[
'/one'
]]);
$foundFiles
=
FileHelper
::
findFiles
(
$basePath
,
[
'except'
=>
[
'/one'
]]);
sort
(
$foundFiles
);
sort
(
$foundFiles
);
$expect
=
array_values
(
array_filter
(
$flat
,
function
(
$p
){
return
strpos
(
$p
,
DIRECTORY_SEPARATOR
.
'one'
)
===
false
;}));
$expect
=
array_values
(
array_filter
(
$flat
,
function
(
$p
)
{
return
strpos
(
$p
,
DIRECTORY_SEPARATOR
.
'one'
)
===
false
;
}));
$this
->
assertEquals
(
$expect
,
$foundFiles
);
$this
->
assertEquals
(
$expect
,
$foundFiles
);
// dir contents
// dir contents
$foundFiles
=
FileHelper
::
findFiles
(
$basePath
,
[
'except'
=>
[
'?*/a.1'
]]);
$foundFiles
=
FileHelper
::
findFiles
(
$basePath
,
[
'except'
=>
[
'?*/a.1'
]]);
sort
(
$foundFiles
);
sort
(
$foundFiles
);
$expect
=
array_values
(
array_filter
(
$flat
,
function
(
$p
)
{
$expect
=
array_values
(
array_filter
(
$flat
,
function
(
$p
)
{
return
substr
(
$p
,
-
11
,
10
)
===
'one'
.
DIRECTORY_SEPARATOR
.
'two'
.
DIRECTORY_SEPARATOR
.
'a.'
||
(
return
substr
(
$p
,
-
11
,
10
)
===
'one'
.
DIRECTORY_SEPARATOR
.
'two'
.
DIRECTORY_SEPARATOR
.
'a.'
||
(
substr
(
$p
,
-
8
)
!==
DIRECTORY_SEPARATOR
.
'one'
.
DIRECTORY_SEPARATOR
.
'a.1'
&&
substr
(
$p
,
-
8
)
!==
DIRECTORY_SEPARATOR
.
'one'
.
DIRECTORY_SEPARATOR
.
'a.1'
&&
substr
(
$p
,
-
10
)
!==
DIRECTORY_SEPARATOR
.
'three'
.
DIRECTORY_SEPARATOR
.
'a.1'
substr
(
$p
,
-
10
)
!==
DIRECTORY_SEPARATOR
.
'three'
.
DIRECTORY_SEPARATOR
.
'a.1'
...
...
This diff is collapsed.
Click to expand it.
tests/unit/framework/helpers/HtmlTest.php
View file @
32d07689
...
@@ -213,7 +213,7 @@ class HtmlTest extends TestCase
...
@@ -213,7 +213,7 @@ class HtmlTest extends TestCase
{
{
$this
->
assertEquals
(
'<input type="radio" name="test" value="1">'
,
Html
::
radio
(
'test'
));
$this
->
assertEquals
(
'<input type="radio" name="test" value="1">'
,
Html
::
radio
(
'test'
));
$this
->
assertEquals
(
'<input type="radio" class="a" name="test" checked>'
,
Html
::
radio
(
'test'
,
true
,
[
'class'
=>
'a'
,
'value'
=>
null
]));
$this
->
assertEquals
(
'<input type="radio" class="a" name="test" checked>'
,
Html
::
radio
(
'test'
,
true
,
[
'class'
=>
'a'
,
'value'
=>
null
]));
$this
->
assertEquals
(
'<input type="hidden" name="test" value="0"><input type="radio" class="a" name="test" value="2" checked>'
,
Html
::
radio
(
'test'
,
true
,
[
'class'
=>
'a'
,
'uncheck'
=>
'0'
,
'value'
=>
2
]));
$this
->
assertEquals
(
'<input type="hidden" name="test" value="0"><input type="radio" class="a" name="test" value="2" checked>'
,
Html
::
radio
(
'test'
,
true
,
[
'class'
=>
'a'
,
'uncheck'
=>
'0'
,
'value'
=>
2
]));
$this
->
assertEquals
(
'<div class="radio"><label class="bbb"><input type="radio" class="a" name="test" checked> ccc</label></div>'
,
Html
::
radio
(
'test'
,
true
,
[
$this
->
assertEquals
(
'<div class="radio"><label class="bbb"><input type="radio" class="a" name="test" checked> ccc</label></div>'
,
Html
::
radio
(
'test'
,
true
,
[
'class'
=>
'a'
,
'class'
=>
'a'
,
...
...
This diff is collapsed.
Click to expand it.
tests/unit/framework/i18n/FallbackMessageFormatterTest.php
View file @
32d07689
...
@@ -97,7 +97,7 @@ _MSG_
...
@@ -97,7 +97,7 @@ _MSG_
[
[
'name'
=>
'Alexander'
,
'name'
=>
'Alexander'
,
'gender'
=>
'male'
,
'gender'
=>
'male'
,
// following should not be replaced
// following should not be replaced
'he'
=>
'wtf'
,
'he'
=>
'wtf'
,
'she'
=>
'wtf'
,
'she'
=>
'wtf'
,
'it'
=>
'wtf'
,
'it'
=>
'wtf'
,
...
...
This diff is collapsed.
Click to expand it.
tests/unit/framework/i18n/I18NTest.php
View file @
32d07689
...
@@ -105,13 +105,13 @@ class I18NTest extends TestCase
...
@@ -105,13 +105,13 @@ class I18NTest extends TestCase
$this
->
assertEquals
(
'Missing translation message.'
,
$this
->
i18n
->
translate
(
'test'
,
'Missing translation message.'
,
[],
'de-DE'
));
$this
->
assertEquals
(
'Missing translation message.'
,
$this
->
i18n
->
translate
(
'test'
,
'Missing translation message.'
,
[],
'de-DE'
));
$this
->
assertEquals
(
'Hallo Welt!'
,
$this
->
i18n
->
translate
(
'test'
,
'Hello world!'
,
[],
'de-DE'
));
$this
->
assertEquals
(
'Hallo Welt!'
,
$this
->
i18n
->
translate
(
'test'
,
'Hello world!'
,
[],
'de-DE'
));
Event
::
on
(
PhpMessageSource
::
className
(),
PhpMessageSource
::
EVENT_MISSING_TRANSLATION
,
function
(
$event
)
{});
Event
::
on
(
PhpMessageSource
::
className
(),
PhpMessageSource
::
EVENT_MISSING_TRANSLATION
,
function
(
$event
)
{});
$this
->
assertEquals
(
'Hallo Welt!'
,
$this
->
i18n
->
translate
(
'test'
,
'Hello world!'
,
[],
'de-DE'
));
$this
->
assertEquals
(
'Hallo Welt!'
,
$this
->
i18n
->
translate
(
'test'
,
'Hello world!'
,
[],
'de-DE'
));
$this
->
assertEquals
(
'Missing translation message.'
,
$this
->
i18n
->
translate
(
'test'
,
'Missing translation message.'
,
[],
'de-DE'
));
$this
->
assertEquals
(
'Missing translation message.'
,
$this
->
i18n
->
translate
(
'test'
,
'Missing translation message.'
,
[],
'de-DE'
));
$this
->
assertEquals
(
'Hallo Welt!'
,
$this
->
i18n
->
translate
(
'test'
,
'Hello world!'
,
[],
'de-DE'
));
$this
->
assertEquals
(
'Hallo Welt!'
,
$this
->
i18n
->
translate
(
'test'
,
'Hello world!'
,
[],
'de-DE'
));
Event
::
off
(
PhpMessageSource
::
className
(),
PhpMessageSource
::
EVENT_MISSING_TRANSLATION
);
Event
::
off
(
PhpMessageSource
::
className
(),
PhpMessageSource
::
EVENT_MISSING_TRANSLATION
);
Event
::
on
(
PhpMessageSource
::
className
(),
PhpMessageSource
::
EVENT_MISSING_TRANSLATION
,
function
(
$event
)
{
Event
::
on
(
PhpMessageSource
::
className
(),
PhpMessageSource
::
EVENT_MISSING_TRANSLATION
,
function
(
$event
)
{
if
(
$event
->
message
==
'New missing translation message.'
)
{
if
(
$event
->
message
==
'New missing translation message.'
)
{
$event
->
translatedMessage
=
'TRANSLATION MISSING HERE!'
;
$event
->
translatedMessage
=
'TRANSLATION MISSING HERE!'
;
}
}
...
@@ -124,4 +124,3 @@ class I18NTest extends TestCase
...
@@ -124,4 +124,3 @@ class I18NTest extends TestCase
Event
::
off
(
PhpMessageSource
::
className
(),
PhpMessageSource
::
EVENT_MISSING_TRANSLATION
);
Event
::
off
(
PhpMessageSource
::
className
(),
PhpMessageSource
::
EVENT_MISSING_TRANSLATION
);
}
}
}
}
This diff is collapsed.
Click to expand it.
tests/unit/framework/log/LoggerTest.php
View file @
32d07689
...
@@ -28,4 +28,4 @@ class LoggerTest extends TestCase
...
@@ -28,4 +28,4 @@ class LoggerTest extends TestCase
$this
->
assertEquals
(
Logger
::
LEVEL_ERROR
,
$logger
->
messages
[
1
][
1
]);
$this
->
assertEquals
(
Logger
::
LEVEL_ERROR
,
$logger
->
messages
[
1
][
1
]);
$this
->
assertEquals
(
'category'
,
$logger
->
messages
[
1
][
2
]);
$this
->
assertEquals
(
'category'
,
$logger
->
messages
[
1
][
2
]);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/framework/log/TargetTest.php
View file @
32d07689
...
@@ -85,4 +85,4 @@ class TestTarget extends Target
...
@@ -85,4 +85,4 @@ class TestTarget extends Target
TargetTest
::
$messages
=
array_merge
(
TargetTest
::
$messages
,
$this
->
messages
);
TargetTest
::
$messages
=
array_merge
(
TargetTest
::
$messages
,
$this
->
messages
);
$this
->
messages
=
[];
$this
->
messages
=
[];
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/framework/mail/BaseMailerTest.php
View file @
32d07689
...
@@ -235,12 +235,11 @@ class BaseMailerTest extends TestCase
...
@@ -235,12 +235,11 @@ class BaseMailerTest extends TestCase
{
{
$message
=
new
Message
();
$message
=
new
Message
();
$mailerMock
=
$this
->
getMockBuilder
(
'yiiunit\framework\mail\Mailer'
)
->
setMethods
([
'beforeSend'
,
'afterSend'
])
->
getMock
();
$mailerMock
=
$this
->
getMockBuilder
(
'yiiunit\framework\mail\Mailer'
)
->
setMethods
([
'beforeSend'
,
'afterSend'
])
->
getMock
();
$mailerMock
->
expects
(
$this
->
once
())
->
method
(
'beforeSend'
)
->
with
(
$message
)
->
will
(
$this
->
returnValue
(
true
));
$mailerMock
->
expects
(
$this
->
once
())
->
method
(
'beforeSend'
)
->
with
(
$message
)
->
will
(
$this
->
returnValue
(
true
));
$mailerMock
->
expects
(
$this
->
once
())
->
method
(
'afterSend'
)
->
with
(
$message
,
true
);
$mailerMock
->
expects
(
$this
->
once
())
->
method
(
'afterSend'
)
->
with
(
$message
,
true
);
$mailerMock
->
send
(
$message
);
$mailerMock
->
send
(
$message
);
}
}
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
tests/unit/framework/mail/BaseMessageTest.php
View file @
32d07689
...
@@ -78,39 +78,62 @@ class TestMessage extends BaseMessage
...
@@ -78,39 +78,62 @@ class TestMessage extends BaseMessage
public
$text
;
public
$text
;
public
$html
;
public
$html
;
public
function
getCharset
()
{
return
''
;}
public
function
getCharset
()
{
return
''
;
}
public
function
setCharset
(
$charset
)
{}
public
function
setCharset
(
$charset
)
{}
public
function
getFrom
()
{
return
''
;}
public
function
getFrom
()
{
return
''
;
}
public
function
setFrom
(
$from
)
{}
public
function
setFrom
(
$from
)
{}
public
function
getReplyTo
()
{
return
''
;}
public
function
getReplyTo
()
{
return
''
;
}
public
function
setReplyTo
(
$replyTo
)
{}
public
function
setReplyTo
(
$replyTo
)
{}
public
function
getTo
()
{
return
''
;}
public
function
getTo
()
{
return
''
;
}
public
function
setTo
(
$to
)
{}
public
function
setTo
(
$to
)
{}
public
function
getCc
()
{
return
''
;}
public
function
getCc
()
{
return
''
;
}
public
function
setCc
(
$cc
)
{}
public
function
setCc
(
$cc
)
{}
public
function
getBcc
()
{
return
''
;}
public
function
getBcc
()
{
return
''
;
}
public
function
setBcc
(
$bcc
)
{}
public
function
setBcc
(
$bcc
){}
public
function
getSubject
()
{
return
''
;}
public
function
getSubject
()
{
return
''
;
}
public
function
setSubject
(
$subject
)
{}
public
function
setSubject
(
$subject
)
{}
public
function
setTextBody
(
$text
)
{
public
function
setTextBody
(
$text
)
{
$this
->
text
=
$text
;
$this
->
text
=
$text
;
}
}
public
function
setHtmlBody
(
$html
)
{
public
function
setHtmlBody
(
$html
)
{
$this
->
html
=
$html
;
$this
->
html
=
$html
;
}
}
...
...
This diff is collapsed.
Click to expand it.
tests/unit/framework/validators/CompareValidatorTest.php
View file @
32d07689
...
@@ -6,8 +6,6 @@ use yii\validators\CompareValidator;
...
@@ -6,8 +6,6 @@ use yii\validators\CompareValidator;
use
yiiunit\data\validators\models\FakedValidationModel
;
use
yiiunit\data\validators\models\FakedValidationModel
;
use
yiiunit\TestCase
;
use
yiiunit\TestCase
;
class
CompareValidatorTest
extends
TestCase
class
CompareValidatorTest
extends
TestCase
{
{
protected
function
setUp
()
protected
function
setUp
()
...
...
This diff is collapsed.
Click to expand it.
tests/unit/framework/validators/DateValidatorTest.php
View file @
32d07689
...
@@ -7,7 +7,6 @@ use yii\validators\DateValidator;
...
@@ -7,7 +7,6 @@ use yii\validators\DateValidator;
use
yiiunit\data\validators\models\FakedValidationModel
;
use
yiiunit\data\validators\models\FakedValidationModel
;
use
yiiunit\TestCase
;
use
yiiunit\TestCase
;
class
DateValidatorTest
extends
TestCase
class
DateValidatorTest
extends
TestCase
{
{
protected
function
setUp
()
protected
function
setUp
()
...
...
This diff is collapsed.
Click to expand it.
tests/unit/framework/validators/DefaultValueValidatorTest.php
View file @
32d07689
<?php
<?php
namespace
yiiunit\framework\validators
;
namespace
yiiunit\framework\validators
;
use
yii\validators\DefaultValueValidator
;
use
yii\validators\DefaultValueValidator
;
use
yiiunit\TestCase
;
use
yiiunit\TestCase
;
...
...
This diff is collapsed.
Click to expand it.
tests/unit/framework/validators/ExistValidatorDriverTests/ExistValidatorPostgresTest.php
View file @
32d07689
...
@@ -7,4 +7,4 @@ use yiiunit\framework\validators\ExistValidatorTest;
...
@@ -7,4 +7,4 @@ use yiiunit\framework\validators\ExistValidatorTest;
class
ExistValidatorPostgresTest
extends
ExistValidatorTest
class
ExistValidatorPostgresTest
extends
ExistValidatorTest
{
{
protected
$driverName
=
'pgsql'
;
protected
$driverName
=
'pgsql'
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/framework/validators/ExistValidatorDriverTests/ExistValidatorSQliteTest.php
View file @
32d07689
...
@@ -7,4 +7,4 @@ use yiiunit\framework\validators\ExistValidatorTest;
...
@@ -7,4 +7,4 @@ use yiiunit\framework\validators\ExistValidatorTest;
class
ExistValidatorSQliteTest
extends
ExistValidatorTest
class
ExistValidatorSQliteTest
extends
ExistValidatorTest
{
{
protected
$driverName
=
'sqlite'
;
protected
$driverName
=
'sqlite'
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/framework/validators/FilterValidatorTest.php
View file @
32d07689
...
@@ -49,4 +49,4 @@ class FilterValidatorTest extends TestCase
...
@@ -49,4 +49,4 @@ class FilterValidatorTest extends TestCase
{
{
return
'not null'
;
return
'not null'
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/framework/validators/NumberValidatorTest.php
View file @
32d07689
...
@@ -144,7 +144,7 @@ class NumberValidatorTest extends TestCase
...
@@ -144,7 +144,7 @@ class NumberValidatorTest extends TestCase
$val
->
validateAttribute
(
$model
,
'attr_number'
);
$val
->
validateAttribute
(
$model
,
'attr_number'
);
$this
->
assertTrue
(
$model
->
hasErrors
(
'attr_number'
));
$this
->
assertTrue
(
$model
->
hasErrors
(
'attr_number'
));
$val
=
new
NumberValidator
([
'min'
=>
1
]);
$val
=
new
NumberValidator
([
'min'
=>
1
]);
$model
=
FakedValidationModel
::
createWithAttributes
([
'attr_num'
=>
[
1
,
2
,
3
]]);
$model
=
FakedValidationModel
::
createWithAttributes
([
'attr_num'
=>
[
1
,
2
,
3
]]);
$val
->
validateAttribute
(
$model
,
'attr_num'
);
$val
->
validateAttribute
(
$model
,
'attr_num'
);
$this
->
assertTrue
(
$model
->
hasErrors
(
'attr_num'
));
$this
->
assertTrue
(
$model
->
hasErrors
(
'attr_num'
));
}
}
...
...
This diff is collapsed.
Click to expand it.
tests/unit/framework/validators/RegularExpressionValidatorTest.php
View file @
32d07689
...
@@ -50,5 +50,4 @@ class RegularExpressionValidatorTest extends TestCase
...
@@ -50,5 +50,4 @@ class RegularExpressionValidatorTest extends TestCase
$val
=
new
RegularExpressionValidator
();
$val
=
new
RegularExpressionValidator
();
$val
->
validate
(
'abc'
);
$val
->
validate
(
'abc'
);
}
}
}
}
This diff is collapsed.
Click to expand it.
tests/unit/framework/validators/UniqueValidatorDriverTests/UniqueValidatorPostgresTest.php
View file @
32d07689
...
@@ -8,4 +8,4 @@ use yiiunit\framework\validators\UniqueValidatorTest;
...
@@ -8,4 +8,4 @@ use yiiunit\framework\validators\UniqueValidatorTest;
class
UniqueValidatorPostgresTest
extends
UniqueValidatorTest
class
UniqueValidatorPostgresTest
extends
UniqueValidatorTest
{
{
protected
$driverName
=
'pgsql'
;
protected
$driverName
=
'pgsql'
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/framework/validators/UniqueValidatorDriverTests/UniqueValidatorSQliteTest.php
View file @
32d07689
...
@@ -8,4 +8,4 @@ use yiiunit\framework\validators\UniqueValidatorTest;
...
@@ -8,4 +8,4 @@ use yiiunit\framework\validators\UniqueValidatorTest;
class
UniqueValidatorSQliteTest
extends
UniqueValidatorTest
class
UniqueValidatorSQliteTest
extends
UniqueValidatorTest
{
{
protected
$driverName
=
'sqlite'
;
protected
$driverName
=
'sqlite'
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/unit/framework/validators/UrlValidatorTest.php
View file @
32d07689
This diff is collapsed.
Click to expand it.
tests/unit/framework/web/AssetBundleTest.php
View file @
32d07689
This diff is collapsed.
Click to expand it.
tests/unit/framework/web/AssetConverterTest.php
View file @
32d07689
This diff is collapsed.
Click to expand it.
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