Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feeds
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
feeds
Commits
e9c27ed5
Commit
e9c27ed5
authored
14 years ago
by
Alex Barth
Browse files
Options
Downloads
Patches
Plain Diff
Remove old file field tests.
parent
fbc27e7e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/feeds_mapper_filefield.test
+0
-106
0 additions, 106 deletions
tests/feeds_mapper_filefield.test
with
0 additions
and
106 deletions
tests/feeds_mapper_filefield.test
deleted
100644 → 0
+
0
−
106
View file @
fbc27e7e
<?php
// $Id$
/**
* @file
* Test case for Filefield mapper mappers/filefield.inc.
*/
require_once
(
drupal_get_path
(
'module'
,
'feeds'
)
.
'/tests/feeds_mapper_test.inc'
);
/**
* Class for testing Feeds FileField mapper.
*
* @todo Add a test for enclosures returned as array
* @todo Add a test for enclosures returned as string
* @todo Add a test for enclosures using local file
*/
class
FeedsMapperFileFieldTestCase
extends
FeedsMapperTestCase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
t
(
'Mapper: FileField'
),
'description'
=>
t
(
'Test Feeds Mapper support for FileField CCK fields. <strong>Requires CCK and filefield module; requires SimplePie library</strong>.'
),
'group'
=>
t
(
'Feeds'
),
);
}
/**
* Set up the
*/
public
function
setUp
()
{
// Call parent setup with the required module
parent
::
setUp
(
'feeds'
,
'feeds_ui'
,
'ctools'
,
'job_scheduler'
,
'content'
,
'filefield'
,
'libraries'
);
// Create user and login
$this
->
drupalLogin
(
$this
->
drupalCreateUser
(
array
(
'administer content types'
,
'administer feeds'
,
'administer nodes'
,
'administer site configuration'
,
)
));
}
/**
* Basic test loading a single entry CSV file.
*/
public
function
test
()
{
$static_title
=
$this
->
randomName
();
//Create content type
$typename
=
$this
->
createContentType
(
NULL
,
array
(
'files'
=>
array
(
'type'
=>
'filefield'
,
'settings'
=>
array
(
'multiple'
=>
'1'
,
'file_extensions'
=>
'jpg'
),
),
));
// Create importer configuration.
$this
->
createImporterConfiguration
();
//Create a default importer configuration
$this
->
setPlugin
(
'syndication'
,
'FeedsSimplePieParser'
);
$this
->
setSettings
(
'syndication'
,
'FeedsNodeProcessor'
,
array
(
'content_type'
=>
$typename
));
//Processor settings
$this
->
addMappings
(
'syndication'
,
array
(
array
(
'source'
=>
'title'
,
'target'
=>
'title'
),
array
(
'source'
=>
'timestamp'
,
'target'
=>
'created'
),
array
(
'source'
=>
'description'
,
'target'
=>
'body'
),
array
(
'source'
=>
'enclosures'
,
'target'
=>
'field_files'
),
));
$nid
=
$this
->
createFeedNode
(
'syndication'
,
$GLOBALS
[
'base_url'
]
.
'/'
.
drupal_get_path
(
'module'
,
'feeds'
)
.
'/tests/feeds/flickr.xml'
);
$this
->
assertText
(
'Created 4 nodes'
);
$filename
=
array
(
'3596408735_ce2f0c4824_b'
,
'2640019371_495c3f51a2_b'
,
'3686290986_334c427e8c_b'
,
'2640845934_85c11e5a18_b'
);
for
(
$i
=
0
;
$i
<
4
;
$i
++
)
{
$this
->
drupalGet
(
'node/'
.
(
$i
+
2
)
.
'/edit'
);
$this
->
assertText
(
$filename
[
$i
]);
}
}
/**
* Handle file field widgets.
*/
public
function
selectFieldWidget
(
$fied_name
,
$field_type
)
{
if
(
$field_type
==
'filefield'
)
{
return
'filefield_widget'
;
}
else
{
return
parent
::
selectFieldWidget
(
$fied_name
,
$field_type
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment