function FileEntityTokenTestCase::testFileEntityTokens in File Entity (fieldable files) 7.3
Same name and namespace in other branches
- 7 tests/file_entity.test \FileEntityTokenTestCase::testFileEntityTokens()
- 7.2 file_entity.test \FileEntityTokenTestCase::testFileEntityTokens()
File
- ./
file_entity.test, line 1120 - Test integration for the file_entity module.
Class
- FileEntityTokenTestCase
- Tests file entity tokens.
Code
function testFileEntityTokens() {
$file = $this
->createFileEntity(array(
'type' => 'document',
));
$tokens = array(
'type' => 'Document',
'type:name' => 'Document',
'type:machine-name' => 'document',
'type:count' => 1,
);
$this
->assertTokens('file', array(
'file' => $file,
), $tokens);
$file = $this
->createFileEntity(array(
'type' => 'image',
));
$tokens = array(
'type' => 'Image',
'type:name' => 'Image',
'type:machine-name' => 'image',
'type:count' => 1,
);
$this
->assertTokens('file', array(
'file' => $file,
), $tokens);
}