Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
222
Merge Requests
222
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
f200debb
Commit
f200debb
authored
Aug 28, 2012
by
tim.plunkett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1760586
by tim.plunkett: Refactor and reorganize the tests.
parent
3e354810
Changes
67
Hide whitespace changes
Inline
Side-by-side
Showing
67 changed files
with
590 additions
and
329 deletions
+590
-329
lib/Drupal/views/Tests/AnalyzeTest.php
lib/Drupal/views/Tests/AnalyzeTest.php
+3
-2
lib/Drupal/views/Tests/BasicTest.php
lib/Drupal/views/Tests/BasicTest.php
+10
-2
lib/Drupal/views/Tests/Comment/ArgumentUserUIDTest.php
lib/Drupal/views/Tests/Comment/ArgumentUserUIDTest.php
+41
-0
lib/Drupal/views/Tests/Comment/CommentTestBase.php
lib/Drupal/views/Tests/Comment/CommentTestBase.php
+14
-48
lib/Drupal/views/Tests/Comment/FilterUserUIDTest.php
lib/Drupal/views/Tests/Comment/FilterUserUIDTest.php
+24
-4
lib/Drupal/views/Tests/Field/ApiDataTest.php
lib/Drupal/views/Tests/Field/ApiDataTest.php
+3
-3
lib/Drupal/views/Tests/Field/FieldTestBase.php
lib/Drupal/views/Tests/Field/FieldTestBase.php
+5
-3
lib/Drupal/views/Tests/Field/HandlerFieldFieldTest.php
lib/Drupal/views/Tests/Field/HandlerFieldFieldTest.php
+3
-3
lib/Drupal/views/Tests/GlossaryTest.php
lib/Drupal/views/Tests/GlossaryTest.php
+3
-2
lib/Drupal/views/Tests/Handler/AreaTextTest.php
lib/Drupal/views/Tests/Handler/AreaTextTest.php
+7
-3
lib/Drupal/views/Tests/Handler/ArgumentNullTest.php
lib/Drupal/views/Tests/Handler/ArgumentNullTest.php
+8
-3
lib/Drupal/views/Tests/Handler/ArgumentStringTest.php
lib/Drupal/views/Tests/Handler/ArgumentStringTest.php
+1
-2
lib/Drupal/views/Tests/Handler/FieldBooleanTest.php
lib/Drupal/views/Tests/Handler/FieldBooleanTest.php
+9
-3
lib/Drupal/views/Tests/Handler/FieldCounterTest.php
lib/Drupal/views/Tests/Handler/FieldCounterTest.php
+9
-3
lib/Drupal/views/Tests/Handler/FieldCustomTest.php
lib/Drupal/views/Tests/Handler/FieldCustomTest.php
+9
-3
lib/Drupal/views/Tests/Handler/FieldDateTest.php
lib/Drupal/views/Tests/Handler/FieldDateTest.php
+9
-3
lib/Drupal/views/Tests/Handler/FieldFileSizeTest.php
lib/Drupal/views/Tests/Handler/FieldFileSizeTest.php
+10
-4
lib/Drupal/views/Tests/Handler/FieldTest.php
lib/Drupal/views/Tests/Handler/FieldTest.php
+5
-3
lib/Drupal/views/Tests/Handler/FieldUrlTest.php
lib/Drupal/views/Tests/Handler/FieldUrlTest.php
+10
-3
lib/Drupal/views/Tests/Handler/FieldXssTest.php
lib/Drupal/views/Tests/Handler/FieldXssTest.php
+10
-4
lib/Drupal/views/Tests/Handler/FilterCombineTest.php
lib/Drupal/views/Tests/Handler/FilterCombineTest.php
+6
-3
lib/Drupal/views/Tests/Handler/FilterDateTest.php
lib/Drupal/views/Tests/Handler/FilterDateTest.php
+3
-2
lib/Drupal/views/Tests/Handler/FilterEqualityTest.php
lib/Drupal/views/Tests/Handler/FilterEqualityTest.php
+5
-3
lib/Drupal/views/Tests/Handler/FilterInOperatorTest.php
lib/Drupal/views/Tests/Handler/FilterInOperatorTest.php
+9
-4
lib/Drupal/views/Tests/Handler/FilterNumericTest.php
lib/Drupal/views/Tests/Handler/FilterNumericTest.php
+6
-4
lib/Drupal/views/Tests/Handler/FilterStringTest.php
lib/Drupal/views/Tests/Handler/FilterStringTest.php
+5
-3
lib/Drupal/views/Tests/Handler/HandlerTestBase.php
lib/Drupal/views/Tests/Handler/HandlerTestBase.php
+17
-0
lib/Drupal/views/Tests/Handler/SortDateTest.php
lib/Drupal/views/Tests/Handler/SortDateTest.php
+10
-4
lib/Drupal/views/Tests/Handler/SortRandomTest.php
lib/Drupal/views/Tests/Handler/SortRandomTest.php
+10
-4
lib/Drupal/views/Tests/Handler/SortTest.php
lib/Drupal/views/Tests/Handler/SortTest.php
+10
-4
lib/Drupal/views/Tests/HandlersTest.php
lib/Drupal/views/Tests/HandlersTest.php
+10
-3
lib/Drupal/views/Tests/Language/LanguageTestBase.php
lib/Drupal/views/Tests/Language/LanguageTestBase.php
+5
-2
lib/Drupal/views/Tests/ModuleTest.php
lib/Drupal/views/Tests/ModuleTest.php
+7
-3
lib/Drupal/views/Tests/Plugin/AccessTest.php
lib/Drupal/views/Tests/Plugin/AccessTest.php
+8
-4
lib/Drupal/views/Tests/Plugin/ArgumentDefaultTest.php
lib/Drupal/views/Tests/Plugin/ArgumentDefaultTest.php
+7
-4
lib/Drupal/views/Tests/Plugin/ArgumentValidatorTest.php
lib/Drupal/views/Tests/Plugin/ArgumentValidatorTest.php
+5
-3
lib/Drupal/views/Tests/Plugin/CacheTest.php
lib/Drupal/views/Tests/Plugin/CacheTest.php
+9
-3
lib/Drupal/views/Tests/Plugin/DisplayTest.php
lib/Drupal/views/Tests/Plugin/DisplayTest.php
+5
-5
lib/Drupal/views/Tests/Plugin/ExposedFormTest.php
lib/Drupal/views/Tests/Plugin/ExposedFormTest.php
+9
-3
lib/Drupal/views/Tests/Plugin/PagerTest.php
lib/Drupal/views/Tests/Plugin/PagerTest.php
+5
-4
lib/Drupal/views/Tests/Plugin/PluginTestBase.php
lib/Drupal/views/Tests/Plugin/PluginTestBase.php
+18
-0
lib/Drupal/views/Tests/Plugin/StyleTest.php
lib/Drupal/views/Tests/Plugin/StyleTest.php
+12
-5
lib/Drupal/views/Tests/Plugin/StyleUnformattedTest.php
lib/Drupal/views/Tests/Plugin/StyleUnformattedTest.php
+11
-6
lib/Drupal/views/Tests/QueryGroupByTest.php
lib/Drupal/views/Tests/QueryGroupByTest.php
+1
-1
lib/Drupal/views/Tests/Taxonomy/RelationshipNodeTermDataTest.php
...pal/views/Tests/Taxonomy/RelationshipNodeTermDataTest.php
+5
-5
lib/Drupal/views/Tests/TranslatableTest.php
lib/Drupal/views/Tests/TranslatableTest.php
+5
-3
lib/Drupal/views/Tests/UI/DefaultViewsTest.php
lib/Drupal/views/Tests/UI/DefaultViewsTest.php
+8
-7
lib/Drupal/views/Tests/UI/GroupByTest.php
lib/Drupal/views/Tests/UI/GroupByTest.php
+6
-15
lib/Drupal/views/Tests/UI/OverrideDisplaysTest.php
lib/Drupal/views/Tests/UI/OverrideDisplaysTest.php
+6
-5
lib/Drupal/views/Tests/UI/SettingsTest.php
lib/Drupal/views/Tests/UI/SettingsTest.php
+7
-13
lib/Drupal/views/Tests/UI/UITestBase.php
lib/Drupal/views/Tests/UI/UITestBase.php
+30
-0
lib/Drupal/views/Tests/UpgradeTestCase.php
lib/Drupal/views/Tests/UpgradeTestCase.php
+7
-5
lib/Drupal/views/Tests/User/ArgumentDefaultTest.php
lib/Drupal/views/Tests/User/ArgumentDefaultTest.php
+6
-5
lib/Drupal/views/Tests/User/ArgumentValidateTest.php
lib/Drupal/views/Tests/User/ArgumentValidateTest.php
+5
-6
lib/Drupal/views/Tests/User/HandlerFieldUserNameTest.php
lib/Drupal/views/Tests/User/HandlerFieldUserNameTest.php
+5
-4
lib/Drupal/views/Tests/User/UserTest.php
lib/Drupal/views/Tests/User/UserTest.php
+19
-8
lib/Drupal/views/Tests/User/UserTestBase.php
lib/Drupal/views/Tests/User/UserTestBase.php
+17
-0
lib/Drupal/views/Tests/ViewStorageTest.php
lib/Drupal/views/Tests/ViewStorageTest.php
+2
-2
lib/Drupal/views/Tests/ViewTest.php
lib/Drupal/views/Tests/ViewTest.php
+3
-3
lib/Drupal/views/Tests/ViewTestBase.php
lib/Drupal/views/Tests/ViewTestBase.php
+28
-2
lib/Drupal/views/Tests/ViewsSchemaTestBase.php
lib/Drupal/views/Tests/ViewsSchemaTestBase.php
+0
-36
lib/Drupal/views/Tests/Wizard/BasicTest.php
lib/Drupal/views/Tests/Wizard/BasicTest.php
+7
-5
lib/Drupal/views/Tests/Wizard/ItemsPerPageTest.php
lib/Drupal/views/Tests/Wizard/ItemsPerPageTest.php
+7
-6
lib/Drupal/views/Tests/Wizard/MenuTest.php
lib/Drupal/views/Tests/Wizard/MenuTest.php
+7
-6
lib/Drupal/views/Tests/Wizard/SortingTest.php
lib/Drupal/views/Tests/Wizard/SortingTest.php
+7
-6
lib/Drupal/views/Tests/Wizard/TaggedWithTest.php
lib/Drupal/views/Tests/Wizard/TaggedWithTest.php
+11
-6
lib/Drupal/views/Tests/Wizard/WizardTestBase.php
lib/Drupal/views/Tests/Wizard/WizardTestBase.php
+6
-3
No files found.
lib/Drupal/views/Tests/AnalyzeTest.php
View file @
f200debb
...
...
@@ -10,12 +10,12 @@
/**
* Tests the views analyze system.
*/
class
AnalyzeTest
extends
View
sSqlTest
{
class
AnalyzeTest
extends
View
TestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Views Analyze'
,
'description'
=>
'Test the views analyze system.'
,
'description'
=>
'Test
s
the views analyze system.'
,
'group'
=>
'Views'
,
);
}
...
...
@@ -46,4 +46,5 @@ function testAnalyzeBasic() {
// This redirects the user back to the main views edit page.
$this
->
drupalPost
(
NULL
,
array
(),
t
(
'Ok'
));
}
}
lib/Drupal/views/Tests/BasicTest.php
View file @
f200debb
...
...
@@ -10,15 +10,22 @@
/**
* Basic test class for Views query builder tests.
*/
class
BasicTest
extends
ViewsSchemaTestBase
{
class
BasicTest
extends
ViewTestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Basic query test'
,
'name'
=>
'Basic query test
s
'
,
'description'
=>
'A basic query test for Views.'
,
'group'
=>
'Views'
);
}
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
enableViewsTestModule
();
}
/**
* Tests a trivial result set.
*/
...
...
@@ -177,4 +184,5 @@ public function testSimpleArgument() {
'views_test_age'
=>
'age'
,
));
}
}
lib/Drupal/views/Tests/Comment/ArgumentUserUIDTest.php
0 → 100644
View file @
f200debb
<?php
/**
* @file
* Definition of Drupal\views\Tests\Comment\ArgumentUserUIDTest.
*/
namespace
Drupal\views\Tests\Comment
;
use
Drupal\views\View
;
/**
* Tests the argument_comment_user_uid handler.
*/
class
ArgumentUserUIDTest
extends
CommentTestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Comment: User UID Argument'
,
'description'
=>
'Tests the user posted or commented argument handler.'
,
'group'
=>
'Views Modules'
,
);
}
function
testCommentUserUIDTest
()
{
$view
=
$this
->
view_comment_user_uid
();
$this
->
executeView
(
$view
,
array
(
$this
->
account
->
uid
));
$result_set
=
array
(
array
(
'nid'
=>
$this
->
node_user_posted
->
nid
,
),
array
(
'nid'
=>
$this
->
node_user_commented
->
nid
,
),
);
$this
->
column_map
=
array
(
'nid'
=>
'nid'
);
$this
->
assertIdenticalResultset
(
$view
,
$result_set
,
$this
->
column_map
);
}
}
lib/Drupal/views/Tests/Comment/
ArgumentCommentUserUidTest
.php
→
lib/Drupal/views/Tests/Comment/
CommentTestBase
.php
View file @
f200debb
...
...
@@ -2,75 +2,40 @@
/**
* @file
* Definition of Drupal\views\Tests\Comment\
ArgumentCommentUserUidTest
.
* Definition of Drupal\views\Tests\Comment\
CommentTestBase
.
*/
namespace
Drupal\views\Tests\Comment
;
use
Drupal\views\Tests\View
sSqlTest
;
use
Drupal\views\Tests\View
TestBase
;
use
Drupal\views\View
;
/**
* Tests the argument_comment_user_uid handler.
*/
class
ArgumentCommentUserUidTest
extends
ViewsSqlTest
{
protected
$profile
=
'standard'
;
abstract
class
CommentTestBase
extends
ViewTestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Tests handler argument_comment_user_uid'
,
'description'
=>
'Tests the user posted or commented argument handler'
,
'group'
=>
'Views Modules'
,
);
}
/**
* Post comment.
*
* @param $node
* Node to post comment on.
* @param $comment
* Comment to save
*/
function
postComment
(
$node
,
$comment
=
array
())
{
$comment
+=
array
(
'uid'
=>
$this
->
loggedInUser
->
uid
,
'nid'
=>
$node
->
nid
,
'cid'
=>
''
,
'pid'
=>
''
,
);
return
entity_create
(
'comment'
,
$comment
)
->
save
();
}
protected
$profile
=
'standard'
;
function
setUp
()
{
parent
::
setUp
();
// Add two users, create a node with the user1 as author and another node
with user2 as author.
// For the second node add a comment from user1.
// Add two users, create a node with the user1 as author and another node
//
with user2 as author.
For the second node add a comment from user1.
$this
->
account
=
$this
->
drupalCreateUser
();
$this
->
account2
=
$this
->
drupalCreateUser
();
$this
->
drupalLogin
(
$this
->
account
);
$this
->
node_user_posted
=
$this
->
drupalCreateNode
();
$this
->
node_user_commented
=
$this
->
drupalCreateNode
(
array
(
'uid'
=>
$this
->
account2
->
uid
));
$this
->
postComment
(
$this
->
node_user_commented
);
}
function
testCommentUserUidTest
()
{
$view
=
$this
->
view_comment_user_uid
();
$this
->
executeView
(
$view
,
array
(
$this
->
account
->
uid
));
$resultset
=
array
(
array
(
'nid'
=>
$this
->
node_user_posted
->
nid
,
),
array
(
'nid'
=>
$this
->
node_user_commented
->
nid
,
),
$comment
=
array
(
'uid'
=>
$this
->
loggedInUser
->
uid
,
'nid'
=>
$this
->
node_user_commented
->
nid
,
'cid'
=>
''
,
'pid'
=>
''
,
);
$this
->
column_map
=
array
(
'nid'
=>
'nid'
);
debug
(
$view
->
result
);
$this
->
assertIdenticalResultset
(
$view
,
$resultset
,
$this
->
column_map
);
entity_create
(
'comment'
,
$comment
)
->
save
();
}
function
view_comment_user_uid
()
{
...
...
@@ -110,4 +75,5 @@ function view_comment_user_uid() {
return
$view
;
}
}
lib/Drupal/views/Tests/Comment/Filter
CommentUserUid
Test.php
→
lib/Drupal/views/Tests/Comment/Filter
UserUID
Test.php
View file @
f200debb
...
...
@@ -2,21 +2,24 @@
/**
* @file
* Definition of Drupal\views\Tests\Comment\Filter
CommentUserUid
Test.
* Definition of Drupal\views\Tests\Comment\Filter
UserUID
Test.
*/
namespace
Drupal\views\Tests\Comment
;
use
Drupal\views\View
;
/**
* Tests the filter_comment_user_uid handler.
*
* The actual stuff is done in the parent class.
*/
class
FilterCommentUserUidTest
extends
ArgumentCommentUserUidTest
{
class
FilterUserUIDTest
extends
CommentTestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'
Tests handler filter_comment_user_uid
'
,
'description'
=>
'Tests the user posted or commented filter handler'
,
'name'
=>
'
Comment: User UID Filter
'
,
'description'
=>
'Tests the user posted or commented filter handler
.
'
,
'group'
=>
'Views Modules'
,
);
}
...
...
@@ -40,4 +43,21 @@ function view_comment_user_uid() {
return
$view
;
}
function
testCommentUserUIDTest
()
{
$view
=
$this
->
view_comment_user_uid
();
$this
->
executeView
(
$view
,
array
(
$this
->
account
->
uid
));
$result_set
=
array
(
array
(
'nid'
=>
$this
->
node_user_posted
->
nid
,
),
array
(
'nid'
=>
$this
->
node_user_commented
->
nid
,
),
);
$this
->
column_map
=
array
(
'nid'
=>
'nid'
);
$this
->
assertIdenticalResultset
(
$view
,
$result_set
,
$this
->
column_map
);
}
}
lib/Drupal/views/Tests/Field/ApiDataTest.php
View file @
f200debb
...
...
@@ -10,7 +10,7 @@
/**
* Test the produced views_data.
*/
class
ApiDataTest
extends
Api
TestBase
{
class
ApiDataTest
extends
Field
TestBase
{
/**
* Stores the fields for this test case.
*/
...
...
@@ -18,8 +18,8 @@ class ApiDataTest extends ApiTestBase {
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Field
api
: Views Data'
,
'description'
=>
'Tests the
fieldapi v
iews data.'
,
'name'
=>
'Field: Views Data'
,
'description'
=>
'Tests the
Field V
iews data.'
,
'group'
=>
'Views Modules'
,
);
}
...
...
lib/Drupal/views/Tests/Field/
Api
TestBase.php
→
lib/Drupal/views/Tests/Field/
Field
TestBase.php
View file @
f200debb
...
...
@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\views\Test\Field\
ApiTestHelper
.
* Definition of Drupal\views\Test\Field\
FieldTestBase
.
*/
/**
...
...
@@ -18,12 +18,13 @@
namespace
Drupal\views\Tests\Field
;
use
Drupal\views\Tests\View
sSqlTest
;
use
Drupal\views\Tests\View
TestBase
;
/**
* Provides some helper methods for testing fieldapi integration into views.
*/
abstract
class
ApiTestBase
extends
ViewsSqlTest
{
abstract
class
FieldTestBase
extends
ViewTestBase
{
protected
$profile
=
'standard'
;
/**
...
...
@@ -71,4 +72,5 @@ function clearViewsCaches() {
$cache
=
NULL
;
$recursion_protection
=
NULL
;
}
}
lib/Drupal/views/Tests/Field/HandlerFieldFieldTest.php
View file @
f200debb
...
...
@@ -17,13 +17,13 @@
* Check locale:disabled, locale:enabled and locale:enabled with another language
* Check revisions
*/
class
HandlerFieldFieldTest
extends
Api
TestBase
{
class
HandlerFieldFieldTest
extends
Field
TestBase
{
public
$nodes
;
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Field
api
: Field handler'
,
'description'
=>
'Tests the field itself of the
fieldapi integration
'
,
'name'
=>
'Field: Field handler'
,
'description'
=>
'Tests the field itself of the
Field integration.
'
,
'group'
=>
'Views Modules'
);
}
...
...
lib/Drupal/views/Tests/GlossaryTest.php
View file @
f200debb
...
...
@@ -10,11 +10,11 @@
/**
* Tests glossary view ( summary of arguments ).
*/
class
GlossaryTest
extends
View
sSqlTest
{
class
GlossaryTest
extends
View
TestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Glossary
Test
'
,
'name'
=>
'Glossary
tests
'
,
'description'
=>
'Tests glossary functionality of views.'
,
'group'
=>
'Views'
,
);
...
...
@@ -56,4 +56,5 @@ public function testGlossaryView() {
$this
->
assertEqual
(
$nodes_per_char
[
$item
->
title_truncated
],
$item
->
num_records
);
}
}
}
lib/Drupal/views/Tests/Handler/AreaTextTest.php
View file @
f200debb
...
...
@@ -7,14 +7,12 @@
namespace
Drupal\views\Tests\Handler
;
use
Drupal\views\Tests\ViewsSchemaTestBase
;
/**
* Tests the text area handler.
*
* @see views_handler_area_text
*/
class
AreaTextTest
extends
ViewsSchema
TestBase
{
class
AreaTextTest
extends
Handler
TestBase
{
public
static
function
getInfo
()
{
return
array
(
...
...
@@ -24,6 +22,12 @@ public static function getInfo() {
);
}
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
enableViewsTestModule
();
}
public
function
testAreaText
()
{
$view
=
$this
->
getBasicView
();
...
...
lib/Drupal/views/Tests/Handler/ArgumentNullTest.php
View file @
f200debb
...
...
@@ -7,12 +7,11 @@
namespace
Drupal\views\Tests\Handler
;
use
Drupal\views\Tests\ViewsSchemaTestBase
;
/**
* Tests the core Drupal\views\Plugin\views\argument\Null handler.
*/
class
ArgumentNullTest
extends
ViewsSchemaTestBase
{
class
ArgumentNullTest
extends
HandlerTestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Argument: Null'
,
...
...
@@ -21,6 +20,12 @@ public static function getInfo() {
);
}
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
enableViewsTestModule
();
}
function
viewsData
()
{
$data
=
parent
::
viewsData
();
$data
[
'views_test'
][
'id'
][
'argument'
][
'id'
]
=
'null'
;
...
...
lib/Drupal/views/Tests/Handler/ArgumentStringTest.php
View file @
f200debb
...
...
@@ -7,13 +7,12 @@
namespace
Drupal\views\Tests\Handler
;
use
Drupal\views\Tests\ViewsSqlTest
;
use
Drupal\views\View
;
/**
* Tests the core Drupal\views\Plugin\views\argument\String handler.
*/
class
ArgumentStringTest
extends
ViewsSqlTest
{
class
ArgumentStringTest
extends
HandlerTestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Argument: String'
,
...
...
lib/Drupal/views/Tests/Handler/FieldBooleanTest.php
View file @
f200debb
...
...
@@ -7,12 +7,11 @@
namespace
Drupal\views\Tests\Handler
;
use
Drupal\views\Tests\ViewsSchemaTestBase
;
/**
* Tests the core Drupal\views\Plugin\views\field\Boolean handler.
*/
class
FieldBooleanTest
extends
ViewsSchemaTestBase
{
class
FieldBooleanTest
extends
HandlerTestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Field: Boolean'
,
...
...
@@ -21,6 +20,12 @@ public static function getInfo() {
);
}
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
enableViewsTestModule
();
}
function
dataSet
()
{
// Use default dataset but remove the age from john and paul
$data
=
parent
::
dataSet
();
...
...
@@ -77,4 +82,5 @@ public function testFieldBoolean() {
$this
->
assertEqual
(
t
(
'Test-True'
),
$view
->
field
[
'age'
]
->
advanced_render
(
$view
->
result
[
1
]));
}
}
lib/Drupal/views/Tests/Handler/FieldCounterTest.php
View file @
f200debb
...
...
@@ -7,12 +7,11 @@
namespace
Drupal\views\Tests\Handler
;
use
Drupal\views\Tests\ViewsSchemaTestBase
;
/**
* Tests the Drupal\views\Plugin\views\field\Counter handler.
*/
class
FieldCounterTest
extends
ViewsSchemaTestBase
{
class
FieldCounterTest
extends
HandlerTestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Field: Counter'
,
...
...
@@ -21,6 +20,12 @@ public static function getInfo() {
);
}
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
enableViewsTestModule
();
}
function
testSimple
()
{
$view
=
$this
->
getBasicView
();
$view
->
display
[
'default'
]
->
handler
->
override_option
(
'fields'
,
array
(
...
...
@@ -71,4 +76,5 @@ function testSimple() {
// @TODO: Write tests for pager.
function
testPager
()
{
}
}
lib/Drupal/views/Tests/Handler/FieldCustomTest.php
View file @
f200debb
...
...
@@ -7,12 +7,11 @@
namespace
Drupal\views\Tests\Handler
;
use
Drupal\views\Tests\ViewsSchemaTestBase
;
/**
* Tests the core Drupal\views\Plugin\views\field\Custom handler.
*/
class
FieldCustomTest
extends
ViewsSchemaTestBase
{
class
FieldCustomTest
extends
HandlerTestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Field: Custom'
,
...
...
@@ -21,6 +20,12 @@ public static function getInfo() {
);
}
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
enableViewsTestModule
();
}
function
viewsData
()
{
$data
=
parent
::
viewsData
();
$data
[
'views_test'
][
'name'
][
'field'
][
'id'
]
=
'custom'
;
...
...
@@ -48,4 +53,5 @@ public function testFieldCustom() {
$this
->
assertEqual
(
$random
,
$view
->
style_plugin
->
get_field
(
0
,
'name'
));
}
}
lib/Drupal/views/Tests/Handler/FieldDateTest.php
View file @
f200debb
...
...
@@ -7,12 +7,11 @@
namespace
Drupal\views\Tests\Handler
;
use
Drupal\views\Tests\ViewsSchemaTestBase
;
/**
* Tests the core Drupal\views\Plugin\views\field\Date handler.
*/
class
FieldDateTest
extends
ViewsSchemaTestBase
{
class
FieldDateTest
extends
HandlerTestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Field: Date'
,
...
...
@@ -21,6 +20,12 @@ public static function getInfo() {
);
}
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
enableViewsTestModule
();
}
function
viewsData
()
{
$data
=
parent
::
viewsData
();
$data
[
'views_test'
][
'created'
][
'field'
][
'id'
]
=
'date'
;
...
...
@@ -88,4 +93,5 @@ protected function assertRenderedDatesEqual($view, $map, $timezone = NULL) {
$this
->
assertEqual
(
$expected_result
,
$actual_result
,
$message
);
}
}
}
lib/Drupal/views/Tests/Handler/FieldFileSizeTest.php
View file @
f200debb
...
...
@@ -7,22 +7,27 @@
namespace
Drupal\views\Tests\Handler
;
use
Drupal\views\Tests\ViewsSchemaTestBase
;
/**
* Tests the core Drupal\views\Plugin\views\field\FileSize handler.
*
* @see CommonXssUnitTest
*/
class
FieldFileSizeTest
extends
ViewsSchemaTestBase
{
class
FieldFileSizeTest
extends
HandlerTestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Field:
file_
size'
,
'name'
=>
'Field:
File
size'
,
'description'
=>
'Test the core Drupal\views\Plugin\views\field\FileSize handler.'
,
'group'
=>
'Views Handlers'
,
);
}
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
enableViewsTestModule
();
}
function
dataSet
()
{
$data
=
parent
::
dataSet
();
$data
[
0
][
'age'
]
=
0
;
...
...
@@ -65,4 +70,5 @@ public function testFieldFileSize() {
$this
->
assertEqual
(
$view
->
field
[
'age'
]
->
advanced_render
(
$view
->
result
[
2
]),
1000
);
$this
->
assertEqual
(
$view
->
field
[
'age'
]
->
advanced_render
(
$view
->
result
[
3
]),
10000
);
}
}
lib/Drupal/views/Tests/Handler/FieldTest.php
View file @
f200debb
...
...
@@ -7,14 +7,13 @@
namespace
Drupal\views\Tests\Handler
;
use
Drupal\views\Tests\ViewsSchemaTestBase
;
/**
* Tests the generic field handler
*
* @see views_handler_field
*/
class
FieldTest
extends
ViewsSchemaTestBase
{
class
FieldTest
extends
HandlerTestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Field'
,
...
...
@@ -25,6 +24,9 @@ public static function getInfo() {
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
enableViewsTestModule
();
$this
->
column_map
=
array
(
'views_test_name'
=>
'name'
,
);
...
...
lib/Drupal/views/Tests/Handler/FieldUrlTest.php
View file @
f200debb
...
...
@@ -7,19 +7,25 @@
namespace
Drupal\views\Tests\Handler
;
use
Drupal\views\Tests\ViewsSchemaTestBase
;
/**
* Tests the core Drupal\views\Plugin\views\field\Url handler.
*/
class
FieldUrlTest
extends
ViewsSchemaTestBase
{
class
FieldUrlTest
extends
HandlerTestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Field: U
rl
'
,
'name'
=>
'Field: U
RL
'
,
'description'
=>
'Test the core Drupal\views\Plugin\views\field\Url handler.'
,
'group'
=>
'Views Handlers'
,